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.

Label Propagation & K-means

samasamaan
Node Clone

Hi

Can I use the k means after Label Propagation? I stored the community as a node property. However, an error occurred:
Failed to invoke procedure gds.alpha.kmeans.write: Caused by: java.lang.NullPointerException

I think that the community should be converted to float and stored as an array. Therefore, I use this script:
//Label_Propagation

CALL gds.labelPropagation.write
('myGraph_1',
 {   maxIterations:15,
     writeProperty: 'community' 
 }
)
YIELD communityCount, ranIterations, didConverge

//Community Set to array of float
MATCH (n:node) SET n.community = [Tofloat(n.community)]

//K-means Write

CALL gds.alpha.kmeans.write('myGraph_1', {
  nodeProperty: 'community',
  k: 2,
  writeProperty: 'kmeans'
})
YIELD communityDistribution

Now the community property is stored as a list of floats (1 value). However, when running the k-means, the same error occurs. Why?

0 REPLIES 0