Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jeff Trull
graph-tool
Commits
d2990fbf
Commit
d2990fbf
authored
Jul 08, 2020
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing documentation file
parent
dfe6ee99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
doc/demos/inference/_assortative.rst
doc/demos/inference/_assortative.rst
+50
-0
No files found.
doc/demos/inference/_assortative.rst
0 → 100644
View file @
d2990fbf
.. _planted_partition:
Assortative community structure
-------------------------------
Traditionally, `"community structure"
<https://en.wikipedia.org/wiki/Community_structure>`_ in the proper
sense refers to groups of nodes that are more connected to each other
than to nodes of other communities. The SBM is capable of representing
this kind of structure without any problems, but in some circumstances
it might make sense to search exclusively for assortative communities
[lizhi-statistical-2020]_. A version of the SBM that is constrained in
this way is called the "planted partition model", which can be inferred
with graph-tool using
:class:`~graph_tool.inference.planted_partition.PPBlockState`. This
class behaves just like
:class:`~graph_tool.inference.blockmodel.BlockState`, therefore all
algorithms described in this documentation work in the same way. Below
we show how this model can be inferred for the football network
considered previously
.. testsetup:: assortative
import os
try:
os.chdir("demos/inference")
except FileNotFoundError:
pass
gt.seed_rng(42)
.. testcode:: assortative
g = gt.collection.data["football"]
state = gt.PPBlockState(g)
# Now we run 1,000 sweeps of the MCMC with zero temperature.
state.multiflip_mcmc_sweep(beta=np.inf, niter=1000)
state.draw(pos=g.vp.pos, output="football-pp.svg")
.. figure:: football-pp.*
:align: center
:width: 350px
Best fit of the degree-corrected planted partition model to a
network of American college football teams.
It is possible to perform model comparison with other model variations
in the same manner as described in :ref:`sec_model_selection` below.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment