PageRankAnchorSelection

class PageRankAnchorSelection(num_anchors=32, max_iter=1000, alpha=0.05, epsilon=0.0001)[source]

Bases: pykeen.nn.node_piece.anchor_selection.SingleSelection

Select entities according to their page rank.

Initialize the selection strategy.

Parameters
  • num_anchors (int) – the number of anchors to select

  • max_iter (int) – the maximum number of power iterations

  • alpha (float) – the smoothing value / teleport probability

  • epsilon (float) – a constant to check for convergence

Methods Summary

extra_repr()

Extra components for __repr__.

rank(edge_index)

Rank nodes.

Methods Documentation

extra_repr()[source]

Extra components for __repr__.

Return type

Iterable[str]

rank(edge_index)[source]

Rank nodes.

Parameters

edge_index (ndarray) – shape: (m, 2) the edge_index, i.e., adjacency list.

Return type

ndarray

Returns

(n,) the node IDs sorted decreasingly by anchor selection preference.