Giter VIP home page Giter VIP logo

python-modularity-maximization's Introduction

Python implementation of Newman's spectral methods to maximize modularity.

See:

A quick start: https://zhiyzuo.github.io/python-modularity-maximization/

All the datasets in ./data comes from http://www-personal.umich.edu/~mejn/netdata/

Specifically, big_10_football_directed.gml is compiled by myself to test community detection for directed network. I combined data from http://www.sports-reference.com/cfb/conferences/big-ten/2005-schedule.html and the original football.gml to define the edge directions.

Change log:

python-modularity-maximization's People

Contributors

zhiyzuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-modularity-maximization's Issues

Regarding the definition of directed modularity

Hi,

I was looking at the get_modularity function from modularity_maximization.utils. Directed modularity is defined as:
Q = \frac{1}{m}\sum_{i,j} \(A_ij - \frac{k_i^{in} k_j^{out}}{m}\) * \detal_{c_i, c_j}
Strictly speaking A_ij should be A_ji, which is 1 when there is an edge from j to i, and 0 otherwise. This is because of the concept that edges j->i should make larger contributions to Q if k_i^{in} or k_j^{out} is small. See Leicht, E. A., & Newman, M. E. J. (2008). Community Structure in Directed Networks. Physical Review Letters, 100(11), 118703, the paragraph following equ.(3).

However, I also believe this is more of a conceptual point, since using either A_ij or A_ji gives the same Q thanks to the (i,j) symmetry in the definition. Please let me know what you think, as I'm still new to the field and am not 100% sure about my 'beliefs' :)

Remove log message

How do I remove the log message when calling modularity_maximization.utils.get_modularity functions?

It keeps printing Calculating modularity for undirected graph every time I call this function.

Error

In community_newman.py:

nx.set_edge_attributes(G=network, name='weight', values={edge:1 for edge in network.edges})

should be:
nx.set_edge_attributes(G=network, name='weight', values={edge:1 for edge in network.edges()})

Should it not? Otherwise I get "TypeError: 'instancemethod' object is not iterable"

Please add Edge's weight support

I want to use your implementation of paper titled "Newman, M. E. J. (2006). Modularity and community structure in networks. Proceedings of the National Academy of Sciences of the United States of America, 103(23), 8577โ€“82" but my graph has weight in it's edges.but this implementation ignore graph weight

Large Network

Hello,

I have a large directed network with 12 000 nodes and 680 000 edges.
Is that possible to use this algorithm in this case ?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.