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
40
Issues
40
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
Tiago Peixoto
graph-tool
Commits
2806a95d
Commit
2806a95d
authored
Jan 08, 2014
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix degree-corrected entropy computation in NestedBlockState
parent
51c50231
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
src/graph_tool/community/nested_blockmodel.py
src/graph_tool/community/nested_blockmodel.py
+8
-12
No files found.
src/graph_tool/community/nested_blockmodel.py
View file @
2806a95d
...
...
@@ -186,6 +186,14 @@ class NestedBlockState(object):
complete
=
complete
)
+
\
partition_entropy
(
B
=
B
,
N
=
N
,
nr
=
nr
)
/
bstate
.
E
if
l
==
0
and
complete
:
if
bstate
.
deg_corr
:
S_seq
=
libcommunity
.
deg_entropy
(
bstate
.
g
.
_Graph__graph
,
_prop
(
"v"
,
bstate
.
g
,
bstate
.
b
),
bstate
.
B
)
S
+=
S_seq
/
bstate
.
E
return
S
def
entropy
(
self
,
complete
=
False
,
random
=
False
,
dense
=
False
,
...
...
@@ -210,18 +218,6 @@ class NestedBlockState(object):
S
=
0
for
l
in
range
(
len
(
self
.
levels
)):
S
+=
self
.
level_entropy
(
l
,
complete
,
random
,
dense
,
multigraph
)
if
complete
:
if
self
.
levels
[
0
].
deg_corr
:
g
=
self
.
levels
[
0
].
g
S_seq
=
0
hist
=
defaultdict
(
int
)
for
v
in
g
.
vertices
():
hist
[(
v
.
in_degree
(),
v
.
out_degree
())]
+=
1
for
k
,
v
in
hist
.
items
():
p
=
v
/
float
(
g
.
num_vertices
())
S_seq
-=
p
*
log
(
p
)
S_seq
*=
g
.
num_vertices
()
S
+=
S_seq
/
self
.
levels
[
0
].
E
return
S
def
get_bstack
(
self
):
...
...
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