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

Implementation of linearized_directed constructor #70

Closed d-schindler closed 1 year ago

d-schindler commented 1 year ago

This PR is to provide linearized MS for directed networks as discussed in #69

d-schindler commented 1 year ago

We need to set $\alpha=1$ (no teleportation) as a default for large graphs because otherwise the quality functions is a dense matrix, which leads to memory errors.

d-schindler commented 1 year ago

We should have constructors_kwargs as an argument in run() such that one can change teleportation conveniently.

d-schindler commented 1 year ago

I think we need to improve the code for constructors by using more scipy.sparse commands.

d-schindler commented 1 year ago

@arnaudon , I think this is ready to merge after your improvements. could you e.g. provide a kwarg in run to set the teleportation parameter alpha?

codecov-commenter commented 1 year ago

Codecov Report

Merging #70 (3554cfe) into master (33890b7) will not change coverage. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##            master       #70   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          552       576   +24     
=========================================
+ Hits           552       576   +24     
Flag Coverage Δ
pytest 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pygenstability/constructors.py 100.00% <100.00%> (ø)
src/pygenstability/pygenstability.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

arnaudon commented 1 year ago

Here you are!

arnaudon commented 1 year ago

Let me know if it's ok, and we can merge!

d-schindler commented 1 year ago

Do you keep the print statements on purpose? Also the print("alpha1")?

arnaudon commented 1 year ago

Oups, I just removed them!

arnaudon commented 1 year ago

is it good to merge like that @d-schindler ?

d-schindler commented 1 year ago

Yes, I think it's fine now!

d-schindler commented 1 year ago

Before you merge, could you delete this from benchmarking.py, it's deprecated: with_spectral_decomp=True