torch_geometric.data.get_features_for_triplets
- get_features_for_triplets(indexer: LargeGraphIndexer, triplets: Iterable[Tuple[Hashable, Hashable, Hashable]], node_feature_name: str = 'x', edge_feature_name: str = 'edge_attr', pre_transform: Optional[Callable[[Tuple[Hashable, Hashable, Hashable]], Tuple[Hashable, Hashable, Hashable]]] = None, verbose: bool = False) Data [source]
- For a given set of triplets retrieve a Data object containing the
unique graph and features from the index.
- Parameters:
indexer (LargeGraphIndexer) – Indexer containing desired features
triplets (KnowledgeGraphLike) – Triplets to fetch features for
node_feature_name (str, optional) – Feature to use for node features. Defaults to “x”.
edge_feature_name (str, optional) – Feature to use for edge features. Defaults to “edge_attr”.
pre_transform (Optional[Callable[[TripletLike], TripletLike]]) – Optional preprocessing function for triplets. Defaults to None.
verbose (bool, optional) – Whether to print progress. Defaults to False.
- Returns:
- Data object containing the unique graph and features from the
index for the given triplets.
- Return type: