Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fast_rp algorithm #1867

Merged
merged 4 commits into from
Nov 25, 2024
Merged

add fast_rp algorithm #1867

merged 4 commits into from
Nov 25, 2024

Conversation

wyatt-joyner-pometry
Copy link
Contributor

NOTE: when running black, some minor formatting changes applied to python/python/raphtory/graphql/__init__.pyi, python/python/raphtory/__init__.pyi, python/tests/graphql/edit_graph/test_graphql.py, python/tests/test_graphdb/test_graphdb.py, and python/python/raphtory/algorithms/__init__.pyi (this last one was expected, since it was auto-generated by pyO3)

What changes were proposed in this pull request?

Added FastRP to algorithms list. Added: Rust implementation; Rust test; Python integration; Python test

Why are the changes needed?

Always good to expand the algorithms library!

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

Yes. The Python and Rust functions include docstrings.

How was this patch tested?

The test includes a small sample graph with a seeded result which conforms to the expectations of the embedding algorithm.

Are there any further changes required?

(This goes for all algorithms!) Add expanded validation testing + scale testing.

Added Rust implementation; Rust test; Python integration; Python test
});
}

// NOTE(Wyatt): the simple fast_rp test is more of a validation of idempotency than correctness (although the results are expected)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as this here - wanna create a fastRP 2.0 ticket to track this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the point of extra testing, perhaps some window tests + layer tests etc - this is probably a good idea for us to add within the larger test pipeline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also yes.

Copy link
Collaborator

@ljeub-pometry ljeub-pometry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor nits, but looks good to merge

python/tests/test_algorithms.py Outdated Show resolved Hide resolved
raphtory/src/algorithms/embeddings/fast_rp.rs Outdated Show resolved Hide resolved
let weights = Arc::clone(&weights);
let ss = vv.eval_graph.ss;
// TODO: rewrite using iters?
for neighbour in vv.neighbours() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this algorithm is treating the network as undirected, would a directed version make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base implementation is only defined for undirected/bidirectional graphs, so this is correct as is. There is, however, a modification I intend to make in the future where different segments of the embedding vector encode different edge types and/or features.

raphtory/src/python/graph/algorithm_result.rs Outdated Show resolved Hide resolved
…ordered AlgorithmResult; make tidy

NOTE: make tidy applied formatting to: python/tests/graphql/test_nodes_property_filter.py, python/tests/graphql/test_graph_nodes_edges_property_filter.py, and python/python/raphtory/__init__.pyi
@wyatt-joyner-pometry wyatt-joyner-pometry merged commit 2951a0c into master Nov 25, 2024
19 checks passed
@wyatt-joyner-pometry wyatt-joyner-pometry deleted the algorithm/fast_rp branch November 25, 2024 16:17
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.

3 participants