Skip to content

Add personalization to pagerank#2554

Draft
phdavis1027 wants to merge 1 commit into
Pometry:db_v4from
phdavis1027:feat-personalized-page-rank
Draft

Add personalization to pagerank#2554
phdavis1027 wants to merge 1 commit into
Pometry:db_v4from
phdavis1027:feat-personalized-page-rank

Conversation

@phdavis1027

@phdavis1027 phdavis1027 commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Two tests with expected values computed via NetworkX:

  • test_personalized_page_rank: all teleport weight on node 1
  • test_personalized_page_rank_partial: weight split between nodes 1 and 3

What changes were proposed in this pull request?

Add a personalization parameter to unweighted_page_rank

If personalization is None, then we dispatch via trait to the exact same calculations as the previous, uniform variant to avoid rounding errors from non-commutative f64 arithmetic.

Why are the changes needed?

To compute personalized page rank (e.g., in fraud-detection situations)

Does this PR introduce any user-facing change? If yes is this documented?

Yes, it adds the personalization parameter to unweighted_pagerank. This is added to docstrings in both python and algorithms/centrality

How was this patch tested?

The unit tests added were validated by computing the same values using networkx.

Are there any further changes required?

I am quite happy to also add a weighted variant

@CLAassistant

CLAassistant commented Apr 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@phdavis1027 phdavis1027 force-pushed the feat-personalized-page-rank branch from b290f9c to 7d375a0 Compare April 16, 2026 03:02
Two tests with expected values computed via NetworkX:
- test_personalized_page_rank: all teleport weight on node 1
- test_personalized_page_rank_partial: weight split between nodes 1 and 3
@phdavis1027 phdavis1027 marked this pull request as draft June 11, 2026 12:07
@phdavis1027 phdavis1027 force-pushed the feat-personalized-page-rank branch from 7d375a0 to 38d5def Compare June 11, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants