DegreeAnchorSelection

class DegreeAnchorSelection(num_anchors: int = 32)[source]

Bases: SingleSelection

Select entities according to their (undirected) degree.

Initialize the strategy.

Parameters:

num_anchors (int) – the number of anchor nodes to select. # TODO: allow relative

Methods Summary

rank(edge_index)

Rank nodes.

Methods Documentation

rank(edge_index: ndarray) ndarray[source]

Rank nodes.

Parameters:

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

Returns:

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

Return type:

ndarray