neo4j / graph-data-science

Source code for the Neo4j Graph Data Science library of graph algorithms.
https://neo4j.com/docs/graph-data-science/current/
Other
596 stars 157 forks source link

kMeans doesn't compute the silhouette nor the distance to centroid #248

Closed tomasonjo closed 1 year ago

tomasonjo commented 1 year ago

GDS version: 2.3.0 Neo4j version: 5.4.0 Operating system: Sandbox

Generate data:

UNWIND range(1,100) AS _
CREATE (:Node {vector:[rand(), rand(), rand()]});

Project the graph:

CALL gds.graph.project('test', 'Node', '*', {nodeProperties:['vector']})

Execute kmeans algo:

CALL gds.beta.kmeans.stats('test', {k:5, nodeProperty:'vector', computeSilhouette: true})
YIELD averageDistanceToCentroid, averageSilhouette

Results:

averageDistanceToCentroid averageSilhouette
0.0 0.0
IoannisPanagiotas commented 1 year ago

Hi @tomasonjo ,

Thank you for brining this to our attention. We've fixed the issue, and it will be available with Gds 2.3.2

I am closing the issue for now :)