Comments (7)
Thanks for reporting this, sorry I did not notice it earlier. It is fixed now.
from bctpy.
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.
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.
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.
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.
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.
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)
- NBS incorrectly(?) lumps positive and negative effects together
- B symmetrization inside if statement in community_louvain
- IndexError: index 2278 is out of bounds for axis 0 with size 2278 HOT 3
- bug: findwalks's for loop index is wrong at it's onset HOT 1
- Wrong description in `kcoreness_centrality_bu` HOT 1
- Update `get_rng` to return Generator instances
- Different implementations to compute global efficiency using bct.charpath and bct.efficiency_wei unclear HOT 1
- Does bct.efficiency_wei also work for directed networks? HOT 1
- Improve generalizability of partition_distance()
- No fucntion get_components.py inside module .algorithms? HOT 1
- Autofix(): Indexing error
- Issue with weighted transitivity and clustering coefficient? HOT 1
- Problem to run bct.modularity_dir with latest numpy HOT 1
- bct.charpath does not exclude 'Infs' in the distance matrix as mentioned in the documentation HOT 1
- Permutation max = 0 at stringent t-thresholds
- Official `bctpy` on `conda-forge` HOT 7
- local_assortativity_wu_sign not separating signs properly
- NBS covariates
- NBS parallel
- Release 0.6.1 missing tar.gz on Pipy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bctpy.