topobench.transforms.data_manipulations.mp_homophily module#
A transform that canculates message passing homophily of the input hypergraph.
- class MessagePassingHomophily(**kwargs)#
Bases:
BaseTransformCalculates message passing homophily of the input data.
This transformation implements the methodology from the paper: “Hypergraph Neural Networks through the Lens of Message Passing: A Common Perspective to Homophily and Architecture Design”. It computes homophily metrics for hypergraphs by analyzing the relationship between node labels within hyperedges.
- Parameters:
- **kwargsdict, optional
Additional parameters for the transform. - top_k : int, default=3
Number of top hyperedge cardinalities to analyze.
- Attributes:
- typestr
Identifier for the transform type.
- top_kint
Number of top hyperedge cardinalities to analyze.
- __init__(**kwargs)#
- forward(data)#
Apply the transform to the input data.
- Parameters:
- datatorch_geometric.data.Data
The input data.
- Returns:
- torch_geometric.data.Data
The transformed data.