R/aPPR.R
, R/graph-igraph.R
, R/graph-rtweet.R
, and 1 more
appr.Rd
Computes the personalized pagerank for specified seeds using the
ApproximatePageRank
algorithm of Andersen et al. (2006). Computes
degree-adjustments and degree-regularization 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 = 1e-06, tau = NULL, verbose = TRUE ) # S3 method for igraph appr(graph, seeds, ...) # S3 method for rtweet_graph appr(graph, seeds, ...) # S3 method for tc_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 in-degree
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 in-degree.
regularized
: The personalized pagerank divide by the node
in-degree 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")#> Error in igraph::`V<-`(`*tmp*`, value = `*vtmp*`): invalid indexing# the portion of the Tracker object you probably care about ppr_results$stats#> Error in eval(expr, envir, enclos): object 'ppr_results' not found