awslabs / awslabs/graphstorm

Enhance Link Prediction Workflow with Integrated Edge Scoring

Open
#1,244 3 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Python
Stars
452
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Right now, after training a model and running inference to get node embeddings (as parquet files), the next step involves manually implementing the scoring logic (like DistMult, Dot Product, TransE, RotatE) to calculate the actual edge scores. This works, but it adds an extra layer of custom scripting that introduces possibilities for implementation errors, especially when ensuring consistency with the training's scoring function.

**Suggestion for Potential Features:**

It would be really helpful if the toolkit could directly support generating these edge scores after inference. Two potential functions come to mind:

1. **A "Predict All Missing Edges" Function:**
* **Concept:** Given a trained model and a specific edge type, this function could calculate scores for all possible edges of that type *that weren't* in the original training graph.
* **Potential Input:** Trained model/embeddings, target edge type.
* **Potential Output:** A parquet file containing `source_node`, `destination_node`, `predicted_score`, and perhaps `probability`.
* **Scoring:** Ideally, it would support the various scoring functions available during training (DistMult, Dot Product, TransE, RotatE mentioned).

2. **A "Predict Specific Edges" Function:**
* **Concept:** Allow users to get scores for a specific list of candidate node pairs efficiently, potentially even if those nodes/edges weren't in the original graph (useful for evolving graphs or what-if scenarios).
* **Potential Input:** Trained model/embeddings, a list of `(source_node, destination_node)` pairs, target edge type.
* **Benefit:** This would avoid the overhead of calculating scores for the entire graph when only a few specific predictions are needed.

**How This Could Help (Use Cases):**

* Simplifies building recommendation systems by directly generating scores for all potential connections.
* Aids in discovering high-probability links missed in the original data.
* Makes it easier to evaluate new potential connections as graphs evolve.
* Allows efficient batch processing of candidate edges without complex graph manipulation.

This is just a suggestion based on our experience, hoping it might be useful input for future development directions. Integrating these steps would certainly make the link prediction process more seamless for us.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing inference workflow that produces node embeddings and the training scoring functions named in the issue: DistMult, Dot Product, TransE, and RotatE. Done would require a decided scope and an implemented, consistent way to score either all missing edges or specified candidate pairs, with the requested output data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.