Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
fda2eafd
Commit
fda2eafd
authored
Jun 26, 2020
by
Tiago Peixoto
Browse files
planted_partition: update docstrings and add convenience methods
parent
f9684ed2
Changes
2
Show whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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