-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bct.community_louvain adjmat must not contain negative weights #63
Comments
I saw a previous post commenting the problem but nobody answer him: |
I have checked the function, in line 110-111 you have this error message if the adjacency matrix has negative values:
But then for lines 122 to 138 if we select the negative_sym option or the_asym the program should continue:
However since you impose first the condition in lines 110-111 the function doesn't execute at all, I think that the condition from line 110-111 should be eliminated, since in lines 122 to 138 this problem is already dealt if the proper objective function isn't chosen. |
I believe you can happily eliminate the lines:
Moreover you need to fix a bit the code, there are a few errors using 'negative_asym' or 'negative_sym'. The value of modularity is normalized by |
Please feel free to submit PRs
…On Wed, Oct 24, 2018 at 8:29 AM Carlo Nicolini, PhD < ***@***.***> wrote:
I believe you can happily eliminate the lines:
if np.min(W) < -1e-10:
raise BCTParamError('adjmat must not contain negative weights')
Moreover you need to fix a bit the code, there are a few errors using
'negative_asym' or 'negative_sym'. The value of modularity is normalized by
s twice in this case and the calculation of both B0 and B1 are wrong.
I'll open a pull request with the fixed code.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#63 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAk9Hq7dEopSVRsPKtx8Cg9BANfXilUYks5uoF1EgaJpZM4Xjlp1>
.
|
Fixed in PR #65 |
Hi,
I am having a problem with the comunity_louvain function, it says that the adjancency matrix cannot have negative values. If my understanding is correct, there shouldn't be a problem, plus the matlab version allows negative values (this is specified in the help) but the python one doesn't?
Cheers,
Vicente
The text was updated successfully, but these errors were encountered: