cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Seed labels in Label Propagation Algorithm

LJRB
Graph Buddy

Hello,

I try to run Label Propagation with my data in Neo4j.

I have two types of nodes : "Articles" and "Keyword"
I have one relationship that link nodes keyword with nodes articles : "Appears_in"

Some articles has labels (string labels) and I don't know how to put this labels in seed labels.

I also don't know how to call LPA with two types of nodes.

Can you help me ?

Thank you

6 REPLIES 6

Can you share your code? And those seed labels will need to be numeric values as far as I'm aware, so you might need to translate the string values to numbers.

Once you've done that you need to specify the seedProperty before you call the algorithm - https://neo4j.com/docs/graph-data-science/current/algorithms/label-propagation/#algorithms-label-pro...

2X_0_0e3b146ae76f6400f8f349dd3d04753af6ccd5cd.jpeg

This is what I have in my database. But I don't know how to code it to call the Label Propagation Algorithm. I think I need to call the LPA in my Jupyter Notebook in order to translate the string values to numbers and then put them in seed property.

I need to call the LPA with seed labels, weight property in the relationship and two types of nodes.

Have you already installed the Graph Data Science Library? You can find installation instructions here - https://neo4j.com/docs/graph-data-science/current/installation/

Once you've done that you can run this query:

call gds.list("") and you should see a list of the available procedures.

Label Propagation documentation is here: https://neo4j.com/docs/graph-data-science/current/algorithms/label-propagation/?&_ga=2.103276736.158...

Yes I already installed the GDS library. Thank you very much for your answer. Do you know if it is possible to call algorithms from Neo4j in a jupyter notebook ?

Yes - you can either do that by using the Neo4j Python driver and execute GDS queries using that...or yo could use a library like pygds - https://github.com/stellasia/pygds

Thank you very much, I'm going to try it