Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Netbone
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
coregraphie
Netbone
Commits
ecd1c411
Commit
ecd1c411
authored
2 years ago
by
Yassin
Browse files
Options
Downloads
Patches
Plain Diff
Refactorings Code and Adding Node Filter
parent
7821ad1e
No related branches found
No related tags found
1 merge request
!1
Adding new methods and the consensual backbone
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
netbone/filters.py
+4
-0
4 additions, 0 deletions
netbone/filters.py
netbone/structural/modulairy_backbone.py
+2
-2
2 additions, 2 deletions
netbone/structural/modulairy_backbone.py
with
6 additions
and
2 deletions
netbone/filters.py
+
4
−
0
View file @
ecd1c411
...
@@ -60,8 +60,12 @@ def fraction_filter(backbone, value, narrate=True, secondary_property='weight',
...
@@ -60,8 +60,12 @@ def fraction_filter(backbone, value, narrate=True, secondary_property='weight',
value
=
math
.
ceil
(
value
*
len
(
data
))
value
=
math
.
ceil
(
value
*
len
(
data
))
return
nx
.
from_pandas_edgelist
(
data
[:
value
],
edge_attr
=
edge_properties
(
data
))
return
nx
.
from_pandas_edgelist
(
data
[:
value
],
edge_attr
=
edge_properties
(
data
))
else
:
else
:
print
(
'
hereeeeeeee
'
)
b
=
backbone
.
graph
.
copy
()
b
=
backbone
.
graph
.
copy
()
value
=
math
.
ceil
(
value
*
len
(
backbone
.
graph
))
value
=
math
.
ceil
(
value
*
len
(
backbone
.
graph
))
print
(
value
)
b
.
remove_nodes_from
(
list
(
data
[:
value
].
index
))
b
.
remove_nodes_from
(
list
(
data
[:
value
].
index
))
return
b
return
b
...
...
This diff is collapsed.
Click to expand it.
netbone/structural/modulairy_backbone.py
+
2
−
2
View file @
ecd1c411
...
@@ -67,7 +67,7 @@ def modularity_backbone(data):
...
@@ -67,7 +67,7 @@ def modularity_backbone(data):
vitalities
=
(
modularity_value
-
q1s
).
tolist
()
vitalities
=
(
modularity_value
-
q1s
).
tolist
()
nx
.
set_node_attributes
(
g
,
dict
(
zip
(
list
(
g
.
nodes
()),
np
.
absolute
(
vitalities
))),
name
=
'
score
'
)
nx
.
set_node_attributes
(
g
,
dict
(
zip
(
list
(
g
.
nodes
()),
np
.
absolute
(
vitalities
))),
name
=
'
vitality
'
)
return
Backbone
(
g
,
method_name
=
"
Modularity Filter
"
,
property_name
=
'
score
'
,
ascending
=
False
,
return
Backbone
(
g
,
method_name
=
"
Modularity Filter
"
,
property_name
=
'
vitality
'
,
ascending
=
False
,
compatible_filters
=
[
threshold_filter
,
fraction_filter
],
filter_on
=
'
Nodes
'
)
compatible_filters
=
[
threshold_filter
,
fraction_filter
],
filter_on
=
'
Nodes
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment