PersonalizedPageRankAnchorSearcher
- class PersonalizedPageRankAnchorSearcher(batch_size: int = 1, use_tqdm: bool = False, page_rank_kwargs: Mapping[str, Any] | None = None)[source]
Bases:
AnchorSearcher
Select closest anchors as the nodes with the largest personalized page rank.
Initialize the searcher.
- Parameters:
Methods Summary
__call__
(edge_index, anchors, k[, num_entities])Find the \(k\) closest anchor nodes for each entity.
Iterate over the components of the
extra_repr()
.precalculate_anchor_ppr
(edge_index, anchors)Sort anchors nodes by PPR values from each node.
Methods Documentation
- __call__(edge_index: ndarray, anchors: ndarray, k: int, num_entities: int | None = None) ndarray [source]
Find the \(k\) closest anchor nodes for each entity.
- Parameters:
- Returns:
shape: (n, k), -1 <= res < a the Ids of the closest anchors
- Return type:
- iter_extra_repr() Iterable[str] [source]
Iterate over the components of the
extra_repr()
.This method is typically overridden. A common pattern would be
def iter_extra_repr(self) -> Iterable[str]: yield from super().iter_extra_repr() yield "<key1>=<value1>" yield "<key2>=<value2>"