Giter Club home page Giter Club logo

npartite's Introduction

npartite

 
このパッケージは,n部ネットワークからのコミュニティ抽出に関連するアルゴリズムを含んでいます.

This package contains some algorithms about community detection from n-partite networks.
(English is here)

概要

2部ネットワークや3部ネットワークなどのn部ネットワークから, コミュニティを抽出するためのアルゴリズムを含んでいます. コミュニティ抽出アルゴリズムはモジュラリティ値の最適化に基づくものです.

コミュニティ抽出アルゴリズムだけではなく, 人工的なn部ネットワークの生成アルゴリズム,コミュニティ抽出結果の評価指標なども含んでいます. 各種アルゴリズムを用いて,人工ネットワークや実ネットワーク上で様々な実験を行うことが可能です.

以下の画像は,3部ネットワークからのコミュニティ抽出の例です.

パッケージの内容

  • 4種類のn部モジュラリティ

  • 3種類のモジュラリティ最適化手法

    • ノードをボトムアップにクラスタリングする手法
    • エッジををボトムアップにクラスタリングする手法
    • FUE(Fast Unfolding for Edges) [Ikematsu 2013]
      • FUEは2種類あります.1つはどのようなn部ネットワークにも適用可能です. もう1つは3部ネットワークのみにしか適用できませんが,高速です.
  • コミュニティ抽出結果の評価指標

    • NMI(正規化相互情報量)[Ana 2003]
  • 人工的なn部ネットワークの生成アルゴリズム

    • (ほぼ)任意の正解構造を持つn部ネットワークを定義して,生成することが可能
    • 生成したn部ネットワークはエッジリストとして利用可能
    • 3部ネットワークについては,既に6種類の人工ネットワークを定義済み [Ikematsu 2014]
      • SIMPLE ケース
      • OVERLAPPING ケース
      • CONTRADICTIVE ケース
      • SIMPLE 3 ケース
      • SIMPLE PLUS ケース
      • SIMPLE 3 PLUS ケース
    • 2部ネットワークは,3部ネットワークにおけるSIMPLE ケースと同様の構造のみ定義済み

必要なモジュール

NMI値を計算するためにはnumpyが必要です.

使い方

以下の例では,SIMPLE ケースのような正解構造を持つ人工3部ネットワークを作成し, それに対してコミュニティ抽出を行っています. また得られたコミュニティ抽出結果を,NMIを用いて正解構造と比較しています.

from npartite.extcom.evaluation import calculate_nmi
from npartite.extcom.modularity import NeubauerModularity
from npartite.extcom.optimization import GreedyVertexBottomUp
from npartite.synthetic.tripartite import SimpleCaseMaker

# make synthetic network
syn_maker = SimpleCaseMaker(corres_egnum=40, noise_ratio=0)
syn_network = syn_maker.make()

# get edge list and correct community structure
edge_list = syn_network.edge_list()
correct_labels = syn_network.correct_community_labels()

# initialize modularity and optimization method
modularity = NeubauerModularity()
optimization = GreedyVertexBottomUp()

# detect communities
results = optimization.start(modularity, edge_list)

# modularity value, 
# detected community labels of the each vertex
# all modularity values through the process of the optimization 
mod_value, detected_labels, mod_values = results

# print each value
print 'modularity value: %f' % (mod_value, )
print 'detected community labels: %s' % (detected_labels, )
print 'correct community labels : %s' % (correct_labels, )
print 'all modularity values through the process: %s' % (mod_values, )


# calculate the value of NMI
nmi = calculate_nmi(detected_labels, correct_labels)
print 'NMI: %f' % (nmi, )

参考文献

  • [Ana 2003] Ana, L., Jain, A.: Robust data clustering. In: Proceedings of 2003 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, vol. 2, pp. II–128–II–133 (2003)
  • [Murata 2010] Murata, T.: Modularity for Heterogeneous Networks, in Proceedings of the 21st ACM Conference on Hypertext and Hypermedia, pp. 129-134 (2010)
  • [Neubauer 2010] Neubauer, N., Obermayer, K.: Community detection in tagging-induced hypergraphs. In: Workshop on Information in Networks (2010)
  • [Ikematsu 2013] Kyohei Ikematsu, Tsuyoshi Murata. A Fast Method for Detecting Communities from Tripartite Networks. In Proceedings of the 5th International Conference on Social Informatics (SocInfo2013), pp.192-205, November 2013, Kyoto Japan
  • [Ikematsu 2014] 池松恭平,村田剛志.3部モジュラリティの改善とその最適化手法.人工知能学会論文誌,Vol.29,No.2,2014,245-258

npartite's People

Contributors

ike002jp avatar

Stargazers

Alexander Goncearenco avatar mattl920@gmail.com avatar  avatar Giulio Rossetti avatar Hossein Taghi-Zadeh avatar Zhe Wang avatar Matthias Grenié avatar Eyad Sibai avatar  avatar hatayou avatar Kevin Lee Stone avatar Stephen Beckett avatar

Watchers

James Cloos avatar Kevin Lee Stone avatar NuODaniel avatar  avatar Zhe Wang avatar  avatar

npartite's Issues

Weighted bipartite

Hi,
Is it possible to apply this package for community detection in weighted bipartite graphs?

Thank you

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.