| Tracker | R Documentation |
R6 class to manage personalized pagerank calculations
R6 class to manage personalized pagerank calculations
seedsA character vector of the seed nodes.
pathA character vector of nodes whose neighborhoods we examined.
statsA 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.
failedA character vector of nodes that could not be visited.
graphAn abstract graph object.
alphaTeleportation constant from Algorithm 3.
alpha_primeTransformed teleportation constant from Algorithm 3.
epsilonError tolerance.
max_visitsMaximum number of nodes to visit before terminating.
tauRegularization parameter used in Algorithm 4.
new()Create a new Tracker object.
Tracker$new(graph, alpha, epsilon, tau, max_visits)
graphSee appr().
alphaSee appr().
epsilonSee appr().
tauSee appr().
max_visitsSee appr().
A new Tracker object.
print()Print the tibble containing the current state of the pagerank calculation.
Tracker$print()
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.
Tracker$remaining()
A character vector of node names with current residuals
greater than epsilon.
current_approximation_error()Determine current quality of approximation.
Tracker$current_approximation_error()
A numeric vector of length one with the current worst error bound.
in_tracker()Check if there is already a row for a particular node
Tracker$in_tracker(nodes)
nodesCharacter name of node(s) in the graph.
TRUE if there is a row for node, FALSE if there
is not a row for node.
in_failed()Check if we previously failed to visit a node
Tracker$in_failed(node)
nodeCharacter name of a node in the graph.
TRUE if we failed to visit node, FALSE otherwise.
Note that this function will return FALSE if node is new
and we haven't seen it before.
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.
Tracker$add_seed(seeds, preference)
seedsThe name of the node in the graph as a length 1 character vector.
preferenceTODO: recall what on earth this is.
add_to_path()TODO
Tracker$add_to_path(node)
nodeThe name of the node in the graph as a length 1 character vector.
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.
Tracker$add_nodes(nodes, preference = 0)
nodesThe name(s) of node(s) in the graph as a character vector.
preferenceTODO: recall what on earth this is.
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.
Tracker$add_failed(nodes)
nodesThe name of the node in the graph as a length 1 character vector.
update_p()Update the estimate of the personalized pagerank for a given node
Tracker$update_p(node)
nodeCharacter name of a node in the graph.
update_r_neighbor()Update the residual of a good node in the neighborhood of the current node, adding it to the tracker if necessary
Tracker$update_r_neighbor(u, v)
uCharacter name of the node we are currently visiting.
vNames of neighbors of u as a character vector. Can
contain multiple elements. Can also contain zero elements.
update_r_self()Update the residual of current node
Tracker$update_r_self(node)
nodeCharacter name of the node we are currently visiting.
regularize()Compute the degree-adjusted and regularized variants of personalized PageRank as in Algorithm 4, based on the outputs of Algorithm 3.
Tracker$regularize()
nodeCharacter name of the node we are currently visiting.
calculate_ppr()Main driver function to perform the computations outlined in Algorithm 3.
Tracker$calculate_ppr()
nodeCharacter name of the node we are currently visiting.
clone()The objects of this class are cloneable with this method.
Tracker$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.