neo4j / graph-data-science-client

A Python client for the Neo4j Graph Data Science (GDS) library
https://neo4j.com/product/graph-data-science/
Apache License 2.0
190 stars 46 forks source link

use the minCommunitySize parameter in Louvain or LPA #706

Open chrisoraruf opened 3 months ago

chrisoraruf commented 3 months ago

Just a question to ask how to use the parameter that it is mentioned also in the original GDS page in the algorithm presentation. Apparently there is some one to one correspondence with some parameters like seedProperty, but cannot make minCommunitySize work.

If somebody know or can tell me how to face the problem would be great.

Cheers.

P:S: example that does not work because of minCommunitySize parameter: gds.louvain.stats(G_largest_component, seedProperty="responsibility", minCommunitySize=20)

vnickolov commented 3 months ago

Hi @chrisoraruf,

Thank you for raising this issue. Yes you are correct that there is correspondence of the parameters between the Python client and the GDS procedures. The example above would not work because minCommunitySize is only supported in stream and write mode of the procedures, meaning that stats and mutate will raise an error if the parameter is used.

I hope this helps.