Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
a77a1cb9
Commit
a77a1cb9
authored
Nov 18, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] some tests to filter links distributional distance.
parent
3c74cc79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
distance.py
analysis/distance.py
+9
-1
No files found.
analysis/distance.py
View file @
a77a1cb9
...
...
@@ -2,10 +2,11 @@ from admin.utils import PrintException
from
gargantext_web.db
import
*
from
collections
import
defaultdict
from
operator
import
itemgetter
from
django.db
import
connection
,
transaction
import
math
from
math
import
log
from
math
import
log
,
sqrt
import
scipy
...
...
@@ -149,6 +150,10 @@ def do_distance(cooc_id, field1=None, field2=None, isMonopartite=True, distance=
if
i
!=
j
and
r
[
i
][
j
]
>
minmax
and
r
[
i
][
j
]
>
r
[
j
][
i
]
]
)
# degree_max = max([(n, d) for n,d in G.degree().items()], key=itemgetter(1))[1]
# nodes_to_remove = [n for (n,d) in G.degree().items() if d <= round(degree_max/2)]
# G.remove_nodes_from(nodes_to_remove)
# Removing too connected nodes (find automatic way to do it)
#edges_to_remove = [ e for e in G.edges_iter() if
...
...
@@ -156,6 +161,9 @@ def do_distance(cooc_id, field1=None, field2=None, isMonopartite=True, distance=
# nodes_to_remove = [n for n in degree if degree[n] <= 1]
# G.remove_nodes_from(nodes_to_remove)
def
getWeight
(
item
):
return
item
[
1
]
#
...
...
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