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
392b1150
Commit
392b1150
authored
Nov 27, 2013
by
Tiago Peixoto
Browse files
Fix small error in partition_entropy()
parent
886b377c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/graph_tool/community/blockmodel.py
View file @
392b1150
...
...
@@ -628,7 +628,7 @@ def partition_entropy(B, N, nr=None):
if
nr
is
None
:
S
=
N
*
log
(
B
)
+
log1p
(
-
(
1
-
1.
/
B
)
**
N
)
else
:
S
=
lbinom
(
B
+
N
-
1
,
N
)
+
scipy
.
special
.
gammaln
(
N
)
-
scipy
.
special
.
gammaln
(
nr
+
1
).
sum
()
S
=
lbinom
(
B
+
N
-
1
,
N
)
+
scipy
.
special
.
gammaln
(
N
+
1
)
-
scipy
.
special
.
gammaln
(
nr
+
1
).
sum
()
return
S
def
get_max_B
(
N
,
E
,
directed
=
False
):
...
...
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