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;








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?.










share|improve this question






























    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?.










    share|improve this question


























      0












      0








      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?.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 5:20









      anniebeniwalanniebeniwal

      32 bronze badges




      32 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          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.






          share|improve this answer

























          • 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










          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
          );



          );














          draft saved

          draft discarded
















          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









          0
















          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.






          share|improve this answer

























          • 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















          0
















          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.






          share|improve this answer

























          • 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













          0














          0










          0









          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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








          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.




















          draft saved

          draft discarded















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해