# Link prediction pipeline output the same probability for all pairs

**URL:** <https://community.neo4j.com/t/link-prediction-pipeline-output-the-same-probability-for-all-pairs/58750>\
**Category:** Neo4j Graph Platform\
**Tags:** migrated\
**Created:** [December 15, 2022, 3:02am UTC](https://community.neo4j.com/t/link-prediction-pipeline-output-the-same-probability-for-all-pairs/58750 "2022-12-15T03:02:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonyip](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jasonyip/32/20205_2.png) [@jasonyip](https://community.neo4j.com/u/jasonyip)\
**Post date:** [December 15, 2022, 3:02am UTC](https://community.neo4j.com/t/link-prediction-pipeline-output-the-same-probability-for-all-pairs/58750/1 "2022-12-15T03:02:14Z")

</div>

Hi,

I am trying to follow the below [example](https://github.com/neo4j-product-examples/demo-link-prediction-pipeline/blob/master/lp-pipeline-for-supervised-er-demo.ipynb) with a different graph. The graph is found at the following location

[https://github.com/grandintegrator/gnn-db-blogpost](https://github.com/grandintegrator/gnn-db-blogpost)

I am pretty sure I built the right graph:

// Nodes  
LOAD CSV WITH HEADERS FROM 'file:///db\_suppliers.csv' AS row  
MERGE (n:Supplier{SupplierId:row.Supplier});

// Edges  
LOAD CSV WITH HEADERs FROM 'file:///gnn\_blog\_full.csv' AS row  
MATCH (a:Supplier{`SupplierId`:row.Purchaser}), (b:Supplier{`SupplierId`:row.Seller})  
MERGE (b)-[r:SUPPLIES\_TO{Probability:toFloat(row.probability)}]-\>(a);

However, all the probabilities came out the same:

[https://colab.research.google.com/drive/1fscHls4qVOtW5-1pOaNDK9atQXvIm7rP?usp=sharing](https://colab.research.google.com/drive/1fscHls4qVOtW5-1pOaNDK9atQXvIm7rP?usp=sharing)

Is there anything I did wrong here? Please help.

Thanks!

---

<div class="post-metadata">

**Author:** ![zach\_blumenfeld](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/zach_blumenfeld/32/19833_2.png) [@zach\_blumenfeld](https://community.neo4j.com/u/zach_blumenfeld)\
**Post date:** [December 22, 2022, 3:35pm UTC](https://community.neo4j.com/t/link-prediction-pipeline-output-the-same-probability-for-all-pairs/58750/2 "2022-12-22T15:35:41Z")

</div>

Hi [@jasonyip](https://community.neo4j.com/t5/user/viewprofilepage/user-id/2799) a couple things to check:

1. How do your embeddings look? If there are many embeddings with all zeros it could reduce the quality and create issues with calibration. You can use the [stream node properties](https://neo4j.com/docs/graph-data-science/current/graph-catalog-node-ops/) operation to read all of them into your notebook, or, alternatively, if the graph is really large you can use the `write` execution mode with FastRP instead of `mutate` which will write them back to the database, and then you can sample with Cypher.

2. Having the model train longer could help with calibration. Increase max epochs, increase patience, increase batchSize, decrease tolerance are all things you can try tuning.
