R6 class to manage personalized pagerank calculations
R6 class to manage personalized pagerank calculations
Public fields
seeds
A character vector of the seed nodes.
path
A character vector of nodes whose neighborhoods we examined.
stats
A
tibble::tibble()
with one row for each visited node and the following columns:name
: Name of a node (character).r
: Current estimate of residual per out-degree for a node.p
: Current estimate of the pagerank for a node.in_degree
: Number of incoming edges to a node.out_degree
: Number of outcoming edges from a node.
failed
A character vector of nodes that could not be visited.
graph
An abstract graph object.
alpha
Teleportation constant from Algorithm 3.
alpha_prime
Transformed teleportation constant from Algorithm 3.
epsilon
Error tolerance.
max_visits
Maximum number of nodes to visit before terminating.
tau
Regularization parameter used in Algorithm 4.
Methods
Method new()
Create a new Tracker object.
Usage
Tracker$new(graph, alpha, epsilon, tau, max_visits)
Method print()
Print the tibble containing the current state of the pagerank calculation.
Method remaining()
Determine nodes that need to be visited. Note that, if there is a node with zero out degree, you will never leave from that node. So it is important to make sure we never add nodes with zero out degree into the tracker.
Method add_seed()
Create an entry for node
in the tracker. Assumes that
node
is not in the tracker yet, and does not check if
this is the case.
Method add_nodes()
Create an entry for node
in the tracker. Assumes that
node
is not in the tracker yet, and does not check if
this is the case.
Method add_failed()
Add node
to the list of nodes we failed to visit.
Assumes that node
is not in the failed list yet, and
does not check if this is the case.
Method update_r_neighbor()
Update the residual of a good node in the neighborhood of the current node, adding it to the tracker if necessary
Method regularize()
Compute the degree-adjusted and regularized variants of personalized PageRank as in Algorithm 4, based on the outputs of Algorithm 3.