Louvian method for desired number of communityFix the seed for the community module in Python that uses networkx moduleSpreading dynamic with community structureCommunity detection on a very large graphDetecting community with python and networkxNetworkx Statistical Inferencetop-down community detection in a networkSingle-community detection algorithmpython - community detection(clustering) using kernighan-lin algorithm in networkx packageHow to do community detection in a edge weighted network/graph?Measuring inter-community interactivity in a network
What is the extent of the commands a Cambion can issue through Fiendish Charm?
Passport - tiny rip on the edge of my passport page
More than 3 domains hosted on IP
Where on Earth is it easiest to survive in the wilderness?
Project Euler problem #112
Why can't some airports handle heavy aircraft while others do it easily (same runway length)?
How do I write a vertically-stacked definition of a sequence?
How do German speakers decide what should be on the left side of the verb?
How do I make my fill-in-the-blank exercise more obvious?
Python reimplementation of Lost In Space by Tim Hartnell
Pronounceable encrypted text
How many attacks exactly do I get combining Dual Wielder feat with Two-Weapon Fighting style?
Why does 8 bit truecolor use only 2 bits for blue?
How could a planet have one hemisphere way warmer than the other without the planet being tidally locked?
"syntax error near unexpected token" after editing .bashrc
How to make a pipe-divided tuple?
Sinning and G-d's will, what's wrong with this logic?
Why is Sojdlg123aljg a common password?
What is the "Brake to Exit" feature on the Boeing 777X?
Leaving the USA
Why did Boris Johnson call for new elections?
How to interpret or parse this confusing 'NOT' and 'AND' legal clause
Poor management handling of recent sickness and how to approach my return?
Examples where "thin + thin = nice and thick"
Louvian method for desired number of community
Fix the seed for the community module in Python that uses networkx moduleSpreading dynamic with community structureCommunity detection on a very large graphDetecting community with python and networkxNetworkx Statistical Inferencetop-down community detection in a networkSingle-community detection algorithmpython - community detection(clustering) using kernighan-lin algorithm in networkx packageHow to do community detection in a edge weighted network/graph?Measuring inter-community interactivity in a network
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Louvian method's build-in version (import community) divides the network into communities which gives the maximum modularity. I want to divide my network into two clusters only.
I am passing the graph to the community module and getting 27 clusters but I want two only so that can be used for classification.
How can I do so?.
networkx social-networking
add a comment |
Louvian method's build-in version (import community) divides the network into communities which gives the maximum modularity. I want to divide my network into two clusters only.
I am passing the graph to the community module and getting 27 clusters but I want two only so that can be used for classification.
How can I do so?.
networkx social-networking
add a comment |
Louvian method's build-in version (import community) divides the network into communities which gives the maximum modularity. I want to divide my network into two clusters only.
I am passing the graph to the community module and getting 27 clusters but I want two only so that can be used for classification.
How can I do so?.
networkx social-networking
Louvian method's build-in version (import community) divides the network into communities which gives the maximum modularity. I want to divide my network into two clusters only.
I am passing the graph to the community module and getting 27 clusters but I want two only so that can be used for classification.
How can I do so?.
networkx social-networking
networkx social-networking
asked Mar 28 at 5:20
anniebeniwalanniebeniwal
32 bronze badges
32 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There are methods designed to return two clusters, sometimes called bisection, for example the Kernighan-Lin algorithm (implemented in NetworkX).
The Louvain algorithm is a bottom-up method which starts by consider each node as its own community. The method merges communities if doing so increases the modularity of the overall partition. The method stops if no such merge is possible. This often happens before only 2 communities are left, so the Louvain algorithm is not a good way to get a bisection. If you insist, you might try to tune the resolution parameter, which governs the size of communities found by Louvain. I think Kernighan-Lin is a much better idea though.
Sir I'm trying to do text document clustering by using community detection algorithms. Like I was trying to do so by using Louvian method but it's dividing words into 8 communities, so I took top 2 and manually checked the accuracy it's giving not that good accuracy. But when I merged all those in 2 and checked accuracy I got above 90 % accuracy.
– anniebeniwal
Mar 29 at 10:39
for example I have a corpus of sports and polities documents so here I want two cluster of words only(one containing words related to sports and other related to polities), so here Kernighan-Lin algorithm may word fine. But Sir what should I do when I have three or more kind of documents in the corpus??.
– anniebeniwal
Mar 29 at 10:39
Moreover Louvian approach (O(n log n)). is faster than Kernighan-Lin method(O(n2 log n)).
– anniebeniwal
Mar 29 at 10:46
If you would like to specify the number of communities, have a look at stochastic block modeling.
– Johannes Wachs
Mar 29 at 22:54
Thank you Sir :)
– anniebeniwal
Apr 8 at 14:41
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390649%2flouvian-method-for-desired-number-of-community%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There are methods designed to return two clusters, sometimes called bisection, for example the Kernighan-Lin algorithm (implemented in NetworkX).
The Louvain algorithm is a bottom-up method which starts by consider each node as its own community. The method merges communities if doing so increases the modularity of the overall partition. The method stops if no such merge is possible. This often happens before only 2 communities are left, so the Louvain algorithm is not a good way to get a bisection. If you insist, you might try to tune the resolution parameter, which governs the size of communities found by Louvain. I think Kernighan-Lin is a much better idea though.
Sir I'm trying to do text document clustering by using community detection algorithms. Like I was trying to do so by using Louvian method but it's dividing words into 8 communities, so I took top 2 and manually checked the accuracy it's giving not that good accuracy. But when I merged all those in 2 and checked accuracy I got above 90 % accuracy.
– anniebeniwal
Mar 29 at 10:39
for example I have a corpus of sports and polities documents so here I want two cluster of words only(one containing words related to sports and other related to polities), so here Kernighan-Lin algorithm may word fine. But Sir what should I do when I have three or more kind of documents in the corpus??.
– anniebeniwal
Mar 29 at 10:39
Moreover Louvian approach (O(n log n)). is faster than Kernighan-Lin method(O(n2 log n)).
– anniebeniwal
Mar 29 at 10:46
If you would like to specify the number of communities, have a look at stochastic block modeling.
– Johannes Wachs
Mar 29 at 22:54
Thank you Sir :)
– anniebeniwal
Apr 8 at 14:41
add a comment |
There are methods designed to return two clusters, sometimes called bisection, for example the Kernighan-Lin algorithm (implemented in NetworkX).
The Louvain algorithm is a bottom-up method which starts by consider each node as its own community. The method merges communities if doing so increases the modularity of the overall partition. The method stops if no such merge is possible. This often happens before only 2 communities are left, so the Louvain algorithm is not a good way to get a bisection. If you insist, you might try to tune the resolution parameter, which governs the size of communities found by Louvain. I think Kernighan-Lin is a much better idea though.
Sir I'm trying to do text document clustering by using community detection algorithms. Like I was trying to do so by using Louvian method but it's dividing words into 8 communities, so I took top 2 and manually checked the accuracy it's giving not that good accuracy. But when I merged all those in 2 and checked accuracy I got above 90 % accuracy.
– anniebeniwal
Mar 29 at 10:39
for example I have a corpus of sports and polities documents so here I want two cluster of words only(one containing words related to sports and other related to polities), so here Kernighan-Lin algorithm may word fine. But Sir what should I do when I have three or more kind of documents in the corpus??.
– anniebeniwal
Mar 29 at 10:39
Moreover Louvian approach (O(n log n)). is faster than Kernighan-Lin method(O(n2 log n)).
– anniebeniwal
Mar 29 at 10:46
If you would like to specify the number of communities, have a look at stochastic block modeling.
– Johannes Wachs
Mar 29 at 22:54
Thank you Sir :)
– anniebeniwal
Apr 8 at 14:41
add a comment |
There are methods designed to return two clusters, sometimes called bisection, for example the Kernighan-Lin algorithm (implemented in NetworkX).
The Louvain algorithm is a bottom-up method which starts by consider each node as its own community. The method merges communities if doing so increases the modularity of the overall partition. The method stops if no such merge is possible. This often happens before only 2 communities are left, so the Louvain algorithm is not a good way to get a bisection. If you insist, you might try to tune the resolution parameter, which governs the size of communities found by Louvain. I think Kernighan-Lin is a much better idea though.
There are methods designed to return two clusters, sometimes called bisection, for example the Kernighan-Lin algorithm (implemented in NetworkX).
The Louvain algorithm is a bottom-up method which starts by consider each node as its own community. The method merges communities if doing so increases the modularity of the overall partition. The method stops if no such merge is possible. This often happens before only 2 communities are left, so the Louvain algorithm is not a good way to get a bisection. If you insist, you might try to tune the resolution parameter, which governs the size of communities found by Louvain. I think Kernighan-Lin is a much better idea though.
answered Mar 28 at 12:52
Johannes WachsJohannes Wachs
7654 silver badges13 bronze badges
7654 silver badges13 bronze badges
Sir I'm trying to do text document clustering by using community detection algorithms. Like I was trying to do so by using Louvian method but it's dividing words into 8 communities, so I took top 2 and manually checked the accuracy it's giving not that good accuracy. But when I merged all those in 2 and checked accuracy I got above 90 % accuracy.
– anniebeniwal
Mar 29 at 10:39
for example I have a corpus of sports and polities documents so here I want two cluster of words only(one containing words related to sports and other related to polities), so here Kernighan-Lin algorithm may word fine. But Sir what should I do when I have three or more kind of documents in the corpus??.
– anniebeniwal
Mar 29 at 10:39
Moreover Louvian approach (O(n log n)). is faster than Kernighan-Lin method(O(n2 log n)).
– anniebeniwal
Mar 29 at 10:46
If you would like to specify the number of communities, have a look at stochastic block modeling.
– Johannes Wachs
Mar 29 at 22:54
Thank you Sir :)
– anniebeniwal
Apr 8 at 14:41
add a comment |
Sir I'm trying to do text document clustering by using community detection algorithms. Like I was trying to do so by using Louvian method but it's dividing words into 8 communities, so I took top 2 and manually checked the accuracy it's giving not that good accuracy. But when I merged all those in 2 and checked accuracy I got above 90 % accuracy.
– anniebeniwal
Mar 29 at 10:39
for example I have a corpus of sports and polities documents so here I want two cluster of words only(one containing words related to sports and other related to polities), so here Kernighan-Lin algorithm may word fine. But Sir what should I do when I have three or more kind of documents in the corpus??.
– anniebeniwal
Mar 29 at 10:39
Moreover Louvian approach (O(n log n)). is faster than Kernighan-Lin method(O(n2 log n)).
– anniebeniwal
Mar 29 at 10:46
If you would like to specify the number of communities, have a look at stochastic block modeling.
– Johannes Wachs
Mar 29 at 22:54
Thank you Sir :)
– anniebeniwal
Apr 8 at 14:41
Sir I'm trying to do text document clustering by using community detection algorithms. Like I was trying to do so by using Louvian method but it's dividing words into 8 communities, so I took top 2 and manually checked the accuracy it's giving not that good accuracy. But when I merged all those in 2 and checked accuracy I got above 90 % accuracy.
– anniebeniwal
Mar 29 at 10:39
Sir I'm trying to do text document clustering by using community detection algorithms. Like I was trying to do so by using Louvian method but it's dividing words into 8 communities, so I took top 2 and manually checked the accuracy it's giving not that good accuracy. But when I merged all those in 2 and checked accuracy I got above 90 % accuracy.
– anniebeniwal
Mar 29 at 10:39
for example I have a corpus of sports and polities documents so here I want two cluster of words only(one containing words related to sports and other related to polities), so here Kernighan-Lin algorithm may word fine. But Sir what should I do when I have three or more kind of documents in the corpus??.
– anniebeniwal
Mar 29 at 10:39
for example I have a corpus of sports and polities documents so here I want two cluster of words only(one containing words related to sports and other related to polities), so here Kernighan-Lin algorithm may word fine. But Sir what should I do when I have three or more kind of documents in the corpus??.
– anniebeniwal
Mar 29 at 10:39
Moreover Louvian approach (O(n log n)). is faster than Kernighan-Lin method(O(n2 log n)).
– anniebeniwal
Mar 29 at 10:46
Moreover Louvian approach (O(n log n)). is faster than Kernighan-Lin method(O(n2 log n)).
– anniebeniwal
Mar 29 at 10:46
If you would like to specify the number of communities, have a look at stochastic block modeling.
– Johannes Wachs
Mar 29 at 22:54
If you would like to specify the number of communities, have a look at stochastic block modeling.
– Johannes Wachs
Mar 29 at 22:54
Thank you Sir :)
– anniebeniwal
Apr 8 at 14:41
Thank you Sir :)
– anniebeniwal
Apr 8 at 14:41
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390649%2flouvian-method-for-desired-number-of-community%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown