Computes the personalized pagerank for specified seeds using the
ApproximatePageRank
algorithm of Andersen et al. (2006). Computes
degreeadjustments and degreeregularization of personalized
pagerank vectors as described in Algorithms 3 and 4 of Chen et al. (2019).
These algorithms are randomized; if results are unstable across
multiple runs, decrease epsilon
.
appr( graph, seeds, ..., alpha = 0.15, epsilon = 1e06, tau = NULL, verbose = TRUE ) # S3 method for igraph appr(graph, seeds, ...) # S3 method for rtweet_graph appr(graph, seeds, ...)
graph  An 

seeds  A character vector of seeds for the personalized pagerank.
The personalized pagerank will return to each of these seeds with
probability 
...  Ignored. Passing arguments to 
alpha  Teleportation constant. The teleportation constant is the
probability of returning to a seed node at each node transition.

epsilon  Desired accuracy of approximation. 
tau  Regularization term. Additionally inflates the indegree
of each observation by this term by performing the degree
adjustment described in Algorithm 3 and Algorithm 4, which
are described in 
verbose  Logical indicating whether to report on the algorithms
progress. Defaults to 
A Tracker()
object. Most relevant is the stats
field,
a tibble::tibble()
with the following columns:
name
: Name of a node (character).
p
: Estimated personalized pagerank of a node.
r
: Estimated error of pagerank estimate for a node.
in_degree
: Number of incoming edges to a node.
out_degree
: Number of outcoming edges from a node.
degree_adjusted
: The personalized pagerank divided by the
node indegree.
regularized
: The personalized pagerank divide by the node
indegree plus tau
.
When computing personalized pageranks for Twitter users (either
via rtweet_graph()
or twittercache_graph()
), name
is given
as a user ID, not a screen name, regardless of how the seed nodes
were specified.
Chen, F., Zhang, Y. & Rohe, K. Targeted sampling from massive Blockmodel graphs with personalized PageRank. 23. http://arxiv.org/abs/1910.12937
Andersen, R., Chung, F. & Lang, K. Local Graph Partitioning using PageRank Vectors. in 2006 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS’06) 475–486 (IEEE, 2006). doi:10.1109/FOCS.2006.44. http://ieeexplore.ieee.org/document/4031383/
#> #>#>#> #>#>#> #>#>#> #>set.seed(27) graph < rtweet_graph() if (FALSE) { appr(graph, "alexpghayes") } graph2 < sample_pa(100) # this creates a Tracker object ppr_results < appr(graph2, seeds = "5") # the portion of the Tracker object you probably care about ppr_results$stats#> # A tibble: 2 x 7 #> name r p in_degree out_degree degree_adjusted regularized #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 5 0.000000833 0.150 2 1 0.0750 0.0300 #> 2 4 0.000000667 0.127 4 1 0.0319 0.0182