| pagerank_metrics | R Documentation |
Compute summary statistics for a vector of PageRank scores. These metrics help characterize how concentrated or dispersed the PageRank distribution is, which is useful when comparing different models or parameter configurations.
pr_gini(x)
pr_entropy(x)
pr_top_k_share(x, k = 0.1)
x |
Numeric vector of non-negative values (typically PageRank scores). |
k |
Fraction of nodes to consider (0 < k <= 1). Default '0.1' (top 10 percent). |
A single numeric value.
A single numeric value (in nats). Returns 'NA' for empty or all-zero inputs.
A single numeric value between 0 and 1 representing the cumulative share.
pr_gini(): Gini coefficient (0 = perfectly equal,
1 = maximally concentrated).
pr_entropy(): Shannon entropy (higher = more uniform
distribution).
pr_top_k_share(): Share of total PageRank held by the top-k
fraction of nodes (e.g., top 10 percent).
pr_gini(c(0.5, 0.3, 0.2))
pr_gini(c(1, 0, 0))
pr_entropy(c(1 / 3, 1 / 3, 1 / 3)) # maximum entropy for 3 nodes
pr_entropy(c(1, 0, 0)) # minimum entropy
pr_top_k_share(c(0.5, 0.3, 0.1, 0.05, 0.05))
pr_top_k_share(c(0.5, 0.3, 0.1, 0.05, 0.05), k = 0.4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.