Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-03-2023 01:57 AM
Hi, I have the following problem. I developed a code on Spark/Python for k-medoids. Now I've managed to load the medoids that come from python directly into neo4j, meaning that spark communicates with neo4j. I also uploaded the data from a csv to neo4j. Both medoids and data have a final label. What I want to do is connect only nodes corresponding to data (each node is a row of this data table) and nodes corresponding to medoids so that each medoid only corresponds to nodes that share the same label as the medoid. I tried everything but it doesn't work with classic queries. You can help me?
02-03-2023 04:43 AM
02-03-2023 05:46 AM
I obtain a list of medoids from my code in python boxed in :
“medoidi_ottimi”.
This contain 10 elements and each element appears like that :
[47, 100, 27, 81, 57, 37, 26, 0, 0, 23, 56, 53, 100, 90, 40, 98, 8]
Each element is a point of an original dataset and the numbers are properties. The last number( 8 in this case) is the “class”.
Now:
Problems:
(Example, I have 10992 point in data set, 10 medoids, I would make evident these 10 medoids in the 10992 points and not simply add them to the points).
b) I would link by arc only the points and medoids with the same “class”labels, for example if the class of medoids is 4, I search all the points with class=4 and link to him, and this for each medoid.
This is my “very simple” code, because I’m new in Neo4J:
match(m:medoids),(p:points) WHERE m.class_ = p.class create (m)-[:BELONGS_TO]->(p)
but it doesn’t work.
I hope you help me.
Thank you 🙂
All the sessions of the conference are now available online