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
fda2eafd
Commit
fda2eafd
authored
Jun 26, 2020
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
planted_partition: update docstrings and add convenience methods
parent
f9684ed2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
doc/demos/inference/inference.rst
doc/demos/inference/inference.rst
+3
-0
src/graph_tool/inference/planted_partition.py
src/graph_tool/inference/planted_partition.py
+18
-0
No files found.
doc/demos/inference/inference.rst
View file @
fda2eafd
...
...
@@ -82,6 +82,9 @@ References
.. [peixoto-revealing-2020] Tiago P. Peixoto, "Revealing consensus and
dissensus between network partitions", :arxiv:`2005.13977`
.. [lizhi-statistical-2020] Lizhi Zhang, Tiago P. Peixoto, "Statistical
inference of assortative community structures", :arxiv:`2006.14493`
.. [peixoto-reconstructing-2018] Tiago P. Peixoto, "Reconstructing
networks with unknown and heterogeneous errors", Phys. Rev. X 8
041011 (2018). :doi:`10.1103/PhysRevX.8.041011`, :arxiv:`1806.07956`
...
...
src/graph_tool/inference/planted_partition.py
View file @
fda2eafd
...
...
@@ -62,6 +62,12 @@ class PPBlockState(object):
b : :class:`~graph_tool.PropertyMap` (optional, default: ``None``)
Initial partition. If not supplied, a partition into a single group will
be used.
References
----------
.. [lizhi-statistical-2020] Lizhi Zhang, Tiago P. Peixoto, "Statistical
inference of assortative community structures", :arxiv:`2006.14493`
"""
def
__init__
(
self
,
g
,
b
=
None
):
...
...
@@ -112,6 +118,14 @@ class PPBlockState(object):
return
"<PPBlockState object with %d blocks, for graph %s, at 0x%x>"
%
\
(
self
.
get_B
(),
str
(
self
.
g
),
id
(
self
))
def
get_blocks
(
self
):
r
"""Returns the property map which contains the block labels for each vertex."""
return
self
.
b
def
get_state
(
self
):
"""Alias to :meth:`~PPBlockState.get_blocks`."""
return
self
.
get_blocks
()
def
get_B
(
self
):
r
"Returns the total number of blocks."
return
len
(
np
.
unique
(
self
.
b
.
fa
))
...
...
@@ -209,6 +223,10 @@ class PPBlockState(object):
For the partition prior :math:`P(\boldsymbol{b})` please refer to
:func:`~graph_tool.inference.blockmodel.model_entropy`.
References
----------
.. [lizhi-statistical-2020] Lizhi Zhang, Tiago P. Peixoto, "Statistical
inference of assortative community structures", :arxiv:`2006.14493`
"""
entropy_args
=
dict
(
self
.
_entropy_args
,
**
locals
())
...
...
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