Git Product home page Git Product logo

Comments (7)

aestrivex avatar aestrivex commented on July 22, 2024

Thanks for reporting this, sorry I did not notice it earlier. It is fixed now.

from bctpy.

mb3152 avatar mb3152 commented on July 22, 2024

No problem. How well tested is the community structure stuff?

On Jul 6, 2015, at 5:25 PM, Roan LaPlante [email protected] wrote:

Thanks for reporting this, sorry I did not notice it earlier. It is fixed now.

β€”
Reply to this email directly or view it on GitHub #12 (comment).

from bctpy.

aestrivex avatar aestrivex commented on July 22, 2024

It's not perfect but modularity is my main interest so most of the functions dealing with modularity are better tested than some of the other functions, and it is also covered by the incomplete test suite. A lot of the modularity functions are very close or identical in behavior to the matlab counterparts. The fine-tuning functions (modularity_finetune_und_sign etc.) may have some obscure problems since in some of my test cases they do often do not improve the modularity when the optimal modular decomposition is extremely degenerate (i.e., the optimal value of the Q metric is very low as in a near-random graph) but they do in more normal cases. I have not been able to track this problem but it is a while since I looked at it carefully.

from bctpy.

mb3152 avatar mb3152 commented on July 22, 2024

Great. Thank you. Mathworks has a nice pipe from python to matlab now, so I will likely run your version and the original matlab version for many of them. I will let you know if I end up finding discrepancies.

On another note, is there are code being developed that combines negative weights with the resolution parameter? Perhaps for Louvain?

Thanks!

On Jul 10, 2015, at 11:52 AM, Roan LaPlante [email protected] wrote:

It's not perfect but modularity is my main interest so most of the functions dealing with modularity are better tested than some of the other functions, and it is also covered by the incomplete test suite. A lot of the modularity functions are very close or identical in behavior to the matlab counterparts. The fine-tuning functions (modularity_finetune_und_sign etc.) may have some obscure problems since in some of my test cases they do often do not improve the modularity when the optimal modular decomposition is extremely degenerate (i.e., the optimal value of the Q metric is very low) but they do in more normal cases. I have not been able to track this problem.

β€”
Reply to this email directly or view it on GitHub #12 (comment).

from bctpy.

aestrivex avatar aestrivex commented on July 22, 2024

The way I am building the test suite now, is having a python terminal and matlab terminal open side by side and try to run functions from both to see if they give the same (or very similar) outputs. If they give different outputs, I try to figure out why and see if it is a real problem (for instance, if you call np.std with no arguments it uses the population standard deviation and matlab by default uses the sample standard deviation, which causes a slight numerical discrepancy in certain functions but is not really a problem).

If the pipe to run matlab code in python really works well (the last time I tried to do something similar it was clunky and annoying), maybe it could also be incorporated into the test suite directly. Help on that is always appreciated.

from bctpy.

mb3152 avatar mb3152 commented on July 22, 2024

I could write this up pretty easily. All one would need is a function to convert the numpy array to matlab’s format, which I have. You could then just loop through every function in the library and look for differences. It would be a lot faster than just having both terminals open!

On Jul 13, 2015, at 8:15 AM, Roan LaPlante [email protected] wrote:

The way I am building the test suite now, is having a python terminal and matlab terminal open side by side and try to run functions from both to see if they give the same (or very similar) outputs. If they give different outputs, I try to figure out why and see if it is a real problem (for instance, if you call np.std with no arguments it uses the population standard deviation and matlab by default uses the sample standard deviation, which causes a slight numerical discrepancy in certain functions but is not really a problem).

If the pipe to run matlab code in python really works well (the last time I tried to do something similar it was clunky and annoying), maybe it could also be incorporated into the test suite directly. Help on that is always appreciated.

β€”
Reply to this email directly or view it on GitHub #12 (comment).

from bctpy.

aestrivex avatar aestrivex commented on July 22, 2024

Keep in mind that there are a lot -- really a lot -- of differences between the implementations that are not necessarily a problem. One difference I found was that by default matlab uses the sample standard deviation and numpy uses the population standard deviation if you don't include extra arguments, which caused the results of some functions to differ slightly.

Another difference is that the libraries used to do the eigendecomposition in matlab and numpy return similar but nonidentical results, which caused e.g. the modular decomposition in certain functions to differ slightly between the two implementations.

from bctpy.

Related Issues (20)

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.