Commit 41471e3c authored by Tiago Peixoto's avatar Tiago Peixoto

Refactor 'community' module and rename to 'inference'

This is a significant refactoring of the statistical inference code,
with many cleanups and improvements, and is aimed towards future
extensibility.

The old community module is available as 'community_old' and will be
completely removed in the near future.
parent 4843cf1a
Pipeline #126 failed with stage
......@@ -18,7 +18,7 @@ nobase_dist_graphtooldoc_DATA = \
doc/draw.rst \
doc/index.rst \
doc/spectral.rst \
doc/community.rst \
doc/inference.rst \
doc/flow.rst \
doc/Makefile \
doc/quickstart.rst \
......@@ -30,7 +30,6 @@ nobase_dist_graphtooldoc_DATA = \
doc/topology.rst \
doc/conf.py \
doc/pyenv.py \
doc/community.xml \
doc/search_example.xml \
doc/sphinxext/README.txt \
doc/sphinxext/LICENSE.txt \
......
......@@ -457,11 +457,12 @@ src/Makefile
src/graph/Makefile
src/graph/centrality/Makefile
src/graph/clustering/Makefile
src/graph/community/Makefile
src/graph/community_old/Makefile
src/graph/correlations/Makefile
src/graph/draw/Makefile
src/graph/flow/Makefile
src/graph/generation/Makefile
src/graph/inference/Makefile
src/graph/layout/Makefile
src/graph/search/Makefile
src/graph/spectral/Makefile
......
.. automodule:: graph_tool.community
:no-members:
:no-undoc-members:
.. autofunction:: minimize_blockmodel_dl
.. autoclass:: BlockState
.. autoclass:: OverlapBlockState
.. autoclass:: CovariateBlockState
.. autofunction:: mcmc_sweep
.. autofunction:: multilevel_minimize
.. autofunction:: collect_edge_marginals
.. autofunction:: collect_vertex_marginals
.. autofunction:: mf_entropy
.. autofunction:: bethe_entropy
.. autofunction:: model_entropy
.. autofunction:: get_max_B
.. autofunction:: get_akc
.. autofunction:: condensation_graph
.. autofunction:: minimize_nested_blockmodel_dl
.. autoclass:: NestedBlockState
.. autofunction:: init_nested_state
.. autofunction:: nested_mcmc_sweep
.. autofunction:: nested_tree_sweep
.. autofunction:: get_hierarchy_tree
.. autofunction:: get_block_edge_gradient
.. autofunction:: community_structure
.. autofunction:: modularity
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -207,11 +207,11 @@ Available subpackages
centrality
clustering
collection
community
correlations
draw
flow
generation
inference
search_module
spectral
stats
......
.. automodule:: graph_tool.inference
:no-undoc-members:
:show-inheritance:
.. testcode:: inference_detailed
:hide:
import test_inference
.. testoutput:: inference_detailed
:hide:
:options: -ELLIPSIS, +NORMALIZE_WHITESPACE
directed: True overlap: False layered: False deg-corr: False dl: False
mcmc (unweighted)
(653.7368247664258, 100) 72
mcmc
(709.1284329780722, 103) 67
(26.555814693961594, 102) 68
(-108.54759577258069, 115) 73
merge
(327.7692003897153, 50)
(240.08404807493113, 110)
(80.17105004298814, 115)
shrink
5
directed: True overlap: False layered: False deg-corr: False dl: True
mcmc (unweighted)
(37.79906768205631, 105) 77
mcmc
(55.97800577471912, 107) 72
(-83.84539912129875, 99) 61
(60.363819212130494, 114) 73
merge
(-403.6228272212937, 50)
(-2.5333139051913243, 104)
(19.27758710817686, 115)
shrink
5
directed: True overlap: False layered: False deg-corr: True dl: False
mcmc (unweighted)
(448.9786966541199, 102) 79
mcmc
(523.3965114137179, 106) 74
(-25.920853037839876, 103) 74
(25.289255024521793, 113) 74
merge
(277.5286735275392, 50)
(358.72935230058386, 101)
(-115.7860369979704, 115)
shrink
5
directed: True overlap: False layered: False deg-corr: True dl: True
mcmc (unweighted)
(-370.02300429105844, 97) 68
mcmc
(-236.5251583848658, 104) 77
(-90.66222214522463, 104) 71
(22.38348339446021, 112) 72
merge
(-747.2417795796297, 50)
(-137.5051248827061, 100)
(-22.19343083384164, 113)
shrink
5
directed: True overlap: False layered: covariates deg-corr: False dl: False
mcmc (unweighted)
(676.3594764878382, 114) 72
mcmc
(659.612425515866, 109) 73
(-7.114556958148668, 115) 75
(12.450844591087305, 115) 73
merge
(546.8411931837169, 50)
(446.7766774894063, 111)
(-233.62505581815967, 115)
shrink
5
directed: True overlap: False layered: covariates deg-corr: False dl: True
mcmc (unweighted)
(11.134477993729128, 113) 71
mcmc
(39.69116889632038, 110) 70
(23.949240858672248, 114) 72
(-20.311156765735674, 115) 75
merge
(-185.8315002121304, 50)
(-8.659869616217907, 113)
(7.1698821344710115, 114)
shrink
5
directed: True overlap: False layered: covariates deg-corr: True dl: False
mcmc (unweighted)
(625.1252715930277, 113) 70
mcmc
(687.1284762185751, 113) 64
(88.17735417358503, 113) 59
(-267.6672513613203, 114) 73
merge
(461.52365374179743, 50)
(554.2643481837697, 109)
(-311.10773578568643, 114)
shrink
5
directed: True overlap: False layered: covariates deg-corr: True dl: True
mcmc (unweighted)
(-265.4943379846294, 111) 76
mcmc
(-260.48845827199153, 115) 75
(-41.58828679977694, 114) 72
(20.07067071778924, 114) 74
merge
(-584.6644045599711, 50)
(-124.7745711915025, 112)
(70.39505964132627, 115)
shrink
5
directed: True overlap: False layered: True deg-corr: False dl: False
mcmc (unweighted)
(649.827058787757, 109) 63
mcmc
(460.97415340386925, 115) 74
(20.20550023851644, 113) 71
(-11.482268963688943, 114) 75
merge
(382.0710697233173, 50)
(659.1089055216413, 112)
(-384.8843394117986, 115)
shrink
5
directed: True overlap: False layered: True deg-corr: False dl: True
mcmc (unweighted)
(-146.93776337069448, 114) 67
mcmc
(-118.54952723454903, 112) 67
(-22.25121342666771, 111) 70
(0.09101846869118524, 113) 72
merge
(-345.98550748381786, 50)
(-19.856093212550192, 111)
(24.406541323617336, 115)
shrink
5
directed: True overlap: False layered: True deg-corr: True dl: False
mcmc (unweighted)
(299.47637000759045, 113) 71
mcmc
(339.7882309572504, 113) 73
(-22.951725336949753, 113) 70
(-71.18214115859378, 115) 76
merge
(112.65674339105865, 50)
(270.7282008346159, 115)
(-48.227031269529164, 115)
shrink
5
directed: True overlap: False layered: True deg-corr: True dl: True
mcmc (unweighted)
(-489.54010405218867, 115) 72
mcmc
(-477.0610489947019, 115) 73
(-44.315852689841975, 111) 70
(-6.031490138403797, 113) 70
merge
(-694.3072536306113, 50)
(-260.61832985101154, 112)
(32.31080727878356, 115)
shrink
5
directed: True overlap: True layered: False deg-corr: False dl: False
mcmc (unweighted)
(684.2122420163477, 1222) 784
(-14.493178594335856, 1340) 787
merge
(0.0, 50)
shrink
5
directed: True overlap: True layered: False deg-corr: False dl: True
mcmc (unweighted)
(-451.273408828854, 1223) 777
(-27.657518258027803, 1340) 769
merge
(-308.96675893350766, 50)
shrink
5
directed: True overlap: True layered: False deg-corr: True dl: False
mcmc (unweighted)
(410.11174108492406, 1226) 756
(-11.783502069519063, 1337) 760
merge
(1.3862943611198906, 50)
shrink
5
directed: True overlap: True layered: False deg-corr: True dl: True
mcmc (unweighted)
(-160.75919034773452, 1225) 785
(-37.94994320552587, 1340) 763
merge
(-326.8859937813693, 50)
shrink
5
directed: True overlap: True layered: covariates deg-corr: False dl: False
mcmc (unweighted)
(6.4407729047092115, 1197) 115
(15.090003687444668, 1306) 115
merge
(-53.01104703350246, 50)
shrink
5
directed: True overlap: True layered: covariates deg-corr: False dl: True
mcmc (unweighted)
(0.7469127360648091, 1189) 115
(-4.454066106756823, 1307) 115
merge
(-1060.3966480302265, 50)
shrink
5
directed: True overlap: True layered: covariates deg-corr: True dl: False
mcmc (unweighted)
(19.34655635911719, 1201) 115
(13.021627155555198, 1302) 115
merge
(139.75704771951064, 50)
shrink
5
directed: True overlap: True layered: covariates deg-corr: True dl: True
mcmc (unweighted)
(-42.609890899551715, 1196) 115
(-20.85691258865186, 1310) 115
merge
(-1234.0387385376016, 50)
shrink
5
directed: True overlap: True layered: True deg-corr: False dl: False
mcmc (unweighted)
(-32.53034167952721, 1201) 115
(56.45069492553456, 1294) 115
merge
(-114.8981755030546, 50)
shrink
5
directed: True overlap: True layered: True deg-corr: False dl: True
mcmc (unweighted)
(-1.035017095430904, 1191) 115
(-4.378896497938934, 1305) 115
merge
(-993.1502579858155, 50)
shrink
5
directed: True overlap: True layered: True deg-corr: True dl: False
mcmc (unweighted)
(6.508901229588357, 1189) 115
(-13.11412599497536, 1301) 115
merge
(-77.33333924925819, 50)
shrink
5
directed: True overlap: True layered: True deg-corr: True dl: True
mcmc (unweighted)
(62.56398098817939, 1195) 115
(-3.5377428709883647, 1304) 115
merge
(-1052.7716211643888, 50)
shrink
5
directed: False overlap: False layered: False deg-corr: False dl: False
mcmc (unweighted)
(693.169084122821, 106) 69
mcmc
(575.1255994230743, 106) 74
(-18.268855666875268, 102) 74
(84.23562085572648, 114) 68
merge
(254.062569976686, 50)
(294.07064838987327, 108)
(-35.54039844306018, 115)
shrink
5
directed: False overlap: False layered: False deg-corr: False dl: True
mcmc (unweighted)
(6.089470037990972, 99) 74
mcmc
(31.337138743014393, 96) 71
(-32.348734568160104, 94) 68
(11.13293108914912, 114) 73
merge
(-452.35567315108005, 50)
(-14.94414868569813, 108)
(-26.47985161842624, 115)
shrink
5
directed: False overlap: False layered: False deg-corr: True dl: False
mcmc (unweighted)
(474.71492598670625, 100) 79
mcmc
(575.0190616712077, 103) 74
(35.03115802167634, 99) 72
(-44.92187114668639, 114) 73
merge
(249.97743129324903, 50)
(425.23174309430004, 110)
(-159.32783404320577, 114)
shrink
5
directed: False overlap: False layered: False deg-corr: True dl: True
mcmc (unweighted)
(-193.2001940253293, 99) 74
mcmc
(-174.90080436460175, 102) 76
(-39.52484390424932, 104) 72
(48.052018152160485, 113) 72
merge
(-717.2044026904009, 50)
(-71.77424635033832, 105)
(-25.114234051660894, 114)
shrink
5
directed: False overlap: False layered: covariates deg-corr: False dl: False
mcmc (unweighted)
(772.5453980570721, 114) 67
mcmc
(720.1691858052512, 112) 69
(68.31407337248119, 111) 65
(-146.74986338638587, 114) 72
merge
(473.38852115957025, 50)
(376.67392866586084, 114)
(1.1626252512182127, 114)
shrink
5
directed: False overlap: False layered: covariates deg-corr: False dl: True
mcmc (unweighted)
(39.60067070934042, 115) 72
mcmc
(-9.194100392728705, 115) 77
(23.758390517950442, 110) 75
(7.399872077643064, 115) 78
merge
(-254.49516803072956, 50)
(-9.215586113589342, 112)
(23.632624271547694, 112)
shrink
5
directed: False overlap: False layered: covariates deg-corr: True dl: False
mcmc (unweighted)
(679.6815899057593, 111) 70
mcmc
(737.5066421528536, 114) 68
(-41.630424206875865, 111) 68
(-71.64216522170558, 114) 73
merge
(483.74983009336034, 50)
(465.972158053492, 114)
(-168.20407971455091, 114)
shrink
5
directed: False overlap: False layered: covariates deg-corr: True dl: True
mcmc (unweighted)
(-246.9705243300452, 113) 67
mcmc
(-236.51398935319358, 113) 68
(83.02986995537107, 113) 78
(-33.29065578699246, 114) 73
merge
(-504.63687228651776, 50)
(-171.50178946195857, 108)
(49.50677409599346, 113)
shrink
5
directed: False overlap: False layered: True deg-corr: False dl: False
mcmc (unweighted)
(540.8663037198617, 113) 68
mcmc
(507.7047847062117, 115) 69
(-56.73592493601191, 113) 74
(14.478960856237514, 114) 75
merge
(385.119877617005, 50)
(609.4426771976545, 112)
(-95.63740447873565, 114)
shrink
5
directed: False overlap: False layered: True deg-corr: False dl: True
mcmc (unweighted)
(-135.48400339347597, 114) 69
mcmc
(-177.55059658149057, 112) 67
(77.30739145915234, 114) 77
(-37.788312169996864, 115) 78
merge
(-378.09608309928564, 50)
(-9.759576031614198, 114)
(-0.9536321167456725, 115)
shrink
5
directed: False overlap: False layered: True deg-corr: True dl: False
mcmc (unweighted)
(416.8858712424856, 114) 72
mcmc
(543.6668155389088, 115) 65
(-116.88680318312439, 114) 78
(64.10454898532073, 114) 70
merge
(344.14747553149675, 50)
(395.5036614885022, 112)
(-144.23929897210388, 115)
shrink
5
directed: False overlap: False layered: True deg-corr: True dl: True
mcmc (unweighted)
(-515.0632865530644, 114) 71
mcmc
(-429.52721402339705, 112) 75
(-97.8538715008062, 110) 69
(61.234048124156786, 115) 73
merge
(-750.3186792142322, 50)
(-289.89054259425507, 109)
(117.72715613340667, 115)
shrink
5
directed: False overlap: True layered: False deg-corr: False dl: False
mcmc (unweighted)
(668.3427656597461, 1225) 785
(25.29309657374884, 1337) 773
merge
(0.0, 50)
shrink
5
directed: False overlap: True layered: False deg-corr: False dl: True
mcmc (unweighted)
(-454.0663525173459, 1223) 770
(-3.768593665481344, 1341) 772
merge
(-302.1438895586243, 50)
shrink
5
directed: False overlap: True layered: False deg-corr: True dl: False
mcmc (unweighted)
(715.484682404301, 1225) 765
(-34.61523962571205, 1341) 784
merge
(34.77514206365362, 50)
shrink
5
directed: False overlap: True layered: False deg-corr: True dl: True
mcmc (unweighted)
(51.108409710889575, 1226) 775
(-5.747478822563901, 1338) 771
merge
(-288.7443154032152, 50)
shrink
5
directed: False overlap: True layered: covariates deg-corr: False dl: False
mcmc (unweighted)
(30.51641860515133, 1198) 115
(-10.213872530535728, 1312) 115
merge
(-279.91158404351484, 50)
shrink
5
directed: False overlap: True layered: covariates deg-corr: False dl: True
mcmc (unweighted)
(-47.83809678456382, 1197) 115
(30.994946483584556, 1306) 115
merge
(-1451.2844212406185, 50)
shrink
5
directed: False overlap: True layered: covariates deg-corr: True dl: False
mcmc (unweighted)
(17.114695467713297, 1193) 115
(6.74992551722728, 1308) 115
merge
(-141.66901107706147, 50)
shrink
5
directed: False overlap: True layered: covariates deg-corr: True dl: True
mcmc (unweighted)
(18.28144731527671, 1186) 115
(-8.899892485955935, 1320) 115
merge
(-2351.4411047024337, 50)
shrink
5
directed: False overlap: True layered: True deg-corr: False dl: False
mcmc (unweighted)
(-30.414601069667068, 1192) 115
(23.38533942611877, 1317) 115
merge
(-160.6578412585288, 50)
shrink
5
directed: False overlap: True layered: True deg-corr: False dl: True