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
70bf7408
Commit
70bf7408
authored
Jul 18, 2016
by
Tiago Peixoto
Browse files
Fix doctests
parent
31a16689
Pipeline
#203
failed with stage
in 4047 minutes and 50 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
doc/Makefile
View file @
70bf7408
...
@@ -5,7 +5,7 @@ latex:
...
@@ -5,7 +5,7 @@ latex:
sphinx-build
-E
-b
latex
.
build
sphinx-build
-E
-b
latex
.
build
test
:
test
:
OMP_NUM_THREADS
=
1
sphinx-build
-b
doctest
.
build
sphinx-build
-b
doctest
.
build
clean
:
clean
:
rm
-rf
build
rm
-rf
build
...
...
doc/conf.py
View file @
70bf7408
...
@@ -196,11 +196,11 @@ latex_elements = {
...
@@ -196,11 +196,11 @@ latex_elements = {
'fontpkg'
:
r
"\usepackage{bookman}"
}
'fontpkg'
:
r
"\usepackage{bookman}"
}
# Example configuration for intersphinx: refer to the Python standard library.
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping
=
{
'python'
:
(
'http://docs.python.org/3'
,
None
),
intersphinx_mapping
=
{
'python'
:
(
'http
s
://docs.python.org/3'
,
None
),
'numpy'
:
(
'http://docs.scipy.org/doc/numpy'
,
None
),
'numpy'
:
(
'http://docs.scipy.org/doc/numpy'
,
None
),
'scipy'
:
(
'http://docs.scipy.org/doc/scipy/reference'
,
None
),
'scipy'
:
(
'http://docs.scipy.org/doc/scipy/reference'
,
None
),
'matplotlib'
:
(
'http://matplotlib.
sourceforge.net
'
,
None
),
'matplotlib'
:
(
'http://matplotlib.
org
'
,
None
),
'cairo'
:
(
'http://www.cairographics.org/documentation/pycairo/3
/
'
,
None
),
'cairo'
:
(
'http
s
://www.cairographics.org/documentation/pycairo/3'
,
None
),
'ipython'
:
(
'http://ipython.org/ipython-doc/stable/'
,
None
),
'ipython'
:
(
'http://ipython.org/ipython-doc/stable/'
,
None
),
'panda'
:
(
'http://pandas.pydata.org/pandas-docs/stable/'
,
None
)}
'panda'
:
(
'http://pandas.pydata.org/pandas-docs/stable/'
,
None
)}
...
...
doc/demos/inference/inference.rst
View file @
70bf7408
...
@@ -506,9 +506,9 @@ example, for the American football network above, we have:
...
@@ -506,9 +506,9 @@ example, for the American football network above, we have:
.. testoutput:: model-selection
.. testoutput:: model-selection
:options: +NORMALIZE_WHITESPACE
:options: +NORMALIZE_WHITESPACE
Non-degree-corrected DL: 17
25.78502074
Non-degree-corrected DL: 17
38.00660528
Degree-corrected DL: 178
4.77629595
Degree-corrected DL: 178
0.01146484
ln Λ: -
58.9912752096
ln Λ: -
42.0048595573
Hence, with a posterior odds ratio of :math:`\Lambda \sim e^{-59} \sim
Hence, with a posterior odds ratio of :math:`\Lambda \sim e^{-59} \sim
10^{-25}` in favor of the non-degree-corrected model, it seems like the
10^{-25}` in favor of the non-degree-corrected model, it seems like the
...
@@ -826,10 +826,9 @@ work, and we can now obtain vertex marginals on all hierarchical levels:
...
@@ -826,10 +826,9 @@ work, and we can now obtain vertex marginals on all hierarchical levels:
Marginal probabilities of group memberships of the network of
Marginal probabilities of group memberships of the network of
characters in the novel Les Misérables, according to the nested
characters in the novel Les Misérables, according to the nested
degree-corrected SBM. The `pie fractions
degree-corrected SBM. The `pie fractions <https://en.wikipedia.org/wiki/Pie_chart>`_
<https://en.wikipedia.org/wiki/Pie_chart>`_ on the nodes correspond
on the nodes correspond to the probability of being in group
to the probability of being in group associated with the respective
associated with the respective color.
color.
We can also obtain a marginal probability of the number of groups
We can also obtain a marginal probability of the number of groups
itself, as follows.
itself, as follows.
...
@@ -1068,7 +1067,7 @@ evidence efficiently, as we show below, using
...
@@ -1068,7 +1067,7 @@ evidence efficiently, as we show below, using
.. testoutput:: model-evidence
.. testoutput:: model-evidence
Model evidence for deg_corr = True: -622.794364945 (mean field), -707.484453595 (Bethe)
Model evidence for deg_corr = True: -622.794364945 (mean field), -707.484453595 (Bethe)
Model evidence for deg_corr = False: -6
33.276625201
(mean field), -6
70.113442151
(Bethe)
Model evidence for deg_corr = False: -6
24.357861783
(mean field), -6
57.164066465
(Bethe)
Despite the (expected) discrepancy between both approximations, the
Despite the (expected) discrepancy between both approximations, the
outcome shows a clear preference for the non-degree-corrected model.
outcome shows a clear preference for the non-degree-corrected model.
...
@@ -1132,8 +1131,8 @@ approach for the same network, using the nested model.
...
@@ -1132,8 +1131,8 @@ approach for the same network, using the nested model.
.. testoutput:: model-evidence
.. testoutput:: model-evidence
Model evidence for deg_corr = True: -5
30.057076507
(mean field), -
702.858734133
(Bethe)
Model evidence for deg_corr = True: -5
49.845093934
(mean field), -
688.382102062
(Bethe)
Model evidence for deg_corr = False: -5
55.073189798
(mean field), -6
49.484851667
(Bethe)
Model evidence for deg_corr = False: -5
93.581546241
(mean field), -6
21.257816805
(Bethe)
The results are interesting: Not only we observe a better evidence for
The results are interesting: Not only we observe a better evidence for
the nested models themselves, when comparing to the evidences for the
the nested models themselves, when comparing to the evidences for the
...
...
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