FeaturesNormalizedTransform
¶
Bases: BaseTransform
Methods:
| Name | Description |
|---|---|
process |
Normalizes the attributes given in the attributes to sum up to one |
Source code in mlx_graphs/transforms/normalize_features.py
process
¶
Normalizes the attributes given in the attributes to sum up to one
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Union[GraphData, GraphDataBatch]
|
A GraphData object with node/edge features |
required |
Returns:
| Type | Description |
|---|---|
Union[GraphData, GraphDataBatch]
|
A GraphData object with normalized features (either edges/node |
Union[GraphData, GraphDataBatch]
|
features unless specified in the transform) |
Example:
from mlx_graphs.datasets import EllipticBitcoinDataset
from mlx_graphs.transforms import FeaturesNormalizedTransform
dataset = EllipticBitcoinDataset(transform=FeaturesNormalizedTransform())
# All the node features (if present) for this graph are normalized
Source code in mlx_graphs/transforms/normalize_features.py
from mlx_graphs.transforms import FeaturesNormalizedTransform · mlx_graphs/transforms/normalize_features.py