barahona-research-group / PyGenStability

PyGenStability: Multiscale community detection with generalized Markov Stability
https://barahona-research-group.github.io/PyGenStability/
GNU General Public License v3.0
32 stars 11 forks source link

Examples #65

Closed d-schindler closed 1 year ago

d-schindler commented 1 year ago

This PR is to make some changes on our presentation of examples.

d-schindler commented 1 year ago

I used the multiscale example to show in the docs. It would be nice to import multiscale_example.create_graph somehow from the /examples folder but I couldn't do it (import didn't work after adding an init to examples). Could somebody else have a look at this? - but also not essential

d-schindler commented 1 year ago

And for the single-scale SBM I now used clusters of the same size which produces nice and easy results where we recover the only partition correctly

d-schindler commented 1 year ago

I also realised that some parts of the documentation are not up to date with the code and docstrings, e.g. here: https://barahona-research-group.github.io/PyGenStability/optimal_scales.html

d-schindler commented 1 year ago

I updated the parameters for the scale selection to make it more robust to noise (kernel size depends on n_scales now). Using these parameters I re-run our examples and things look much better now. I also tweaked min_scale in the multiscale example such that we don't get the partition of singletons. This makes the plot clearer and we need to explain less in the paper.

There was also an issue with Example 3 on my side. Although I have networkx version >= 2.4 as defined in the requirements, I get "module networkx has no attribute to_scipy_sparse_array". So I rewrote the code slightly.

d-schindler commented 1 year ago

I also reran the real examples with the updated scale selection parameters and things look much better.

This branch is now ready to be merged.

d-schindler commented 1 year ago

I think it would be good if we could add more explanations to the constructor classes, perhaps even add the formulas for each constructor expressed through generalised modularity.

d-schindler commented 1 year ago

@arnaudon, do you still want to merge for now?

arnaudon commented 1 year ago

@d-schindler , anything left to do from your comments above? Sorry, I was behind on this one...