Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
670bc6c8
Commit
670bc6c8
authored
Apr 27, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH] Distances
parent
7879431c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
12 deletions
+20
-12
Distances.hs
src/Gargantext/Viz/Graph/Distances.hs
+7
-0
Conditional.hs
src/Gargantext/Viz/Graph/Distances/Conditional.hs
+6
-5
Distributional.hs
src/Gargantext/Viz/Graph/Distances/Distributional.hs
+4
-4
Tools.hs
src/Gargantext/Viz/Graph/Tools.hs
+3
-3
No files found.
src/Gargantext/Viz/Graph/Distances.hs
View file @
670bc6c8
...
...
@@ -17,9 +17,16 @@ module Gargantext.Viz.Graph.Distances
where
import
Data.Array.Accelerate
import
Gargantext.Viz.Graph.Distances.Matrice
(
measureConditional
,
distributional
)
data
Distance
=
Conditional
|
Distributional
measure
::
Distance
->
Matrix
Int
->
Matrix
Double
measure
Conditional
=
measureConditional
measure
Distributional
=
distributional
src/Gargantext/Viz/Graph/Distances/Conditional.hs
View file @
670bc6c8
...
...
@@ -120,12 +120,13 @@ conditional m = filterMat (threshold m') m'
(
length
nodes_kept
)
(
\
(
i
,
j
)
->
getElem
((
M
.!
)
dico_nodes
i
)
((
M
.!
)
dico_nodes
j
)
x'
)
threshold
m''
=
V
.
minimum
$
V
.
map
(
\
cId
->
V
.
maximum
$
getCol
cId
m''
)
(
V
.
enumFromTo
1
(
nOf
Col
m''
))
threshold
m''
=
V
.
minimum
$
V
.
map
(
\
cId
->
V
.
maximum
$
getCol
cId
m''
)
(
V
.
enumFromTo
1
(
nOf
Col
m''
)
)
filterMat
t
m''
=
mapAll
(
\
x
->
filter'
t
x
)
m''
where
filter'
t'
x
=
case
(
x
>=
t'
)
of
True
->
x
False
->
0
------------------------------------------------------------------------
src/Gargantext/Viz/Graph/Distances/Distributional.hs
View file @
670bc6c8
src/Gargantext/Viz/Graph/Tools.hs
View file @
670bc6c8
...
...
@@ -26,7 +26,7 @@ import Gargantext.Prelude
import
Gargantext.Core.Statistics
import
Gargantext.Viz.Graph
import
Gargantext.Viz.Graph.Bridgeness
(
bridgeness
)
import
Gargantext.Viz.Graph.Distances
.Matrice
(
measureConditional
)
import
Gargantext.Viz.Graph.Distances
(
Distance
(
..
),
measure
)
import
Gargantext.Viz.Graph.Index
(
createIndices
,
toIndex
,
map2mat
,
mat2map
,
Index
)
import
Gargantext.Viz.Graph.IGraph
(
mkGraphUfromEdges
)
import
Gargantext.Viz.Graph.Proxemy
(
confluence
)
...
...
@@ -48,7 +48,7 @@ cooc2graph' threshold myCooc = distanceMap
(
ti
,
_
)
=
createIndices
myCooc
myCooc'
=
toIndex
ti
myCooc
matCooc
=
map2mat
0
(
Map
.
size
ti
)
$
Map
.
filter
(
>
1
)
myCooc'
distanceMat
=
measureConditional
matCooc
distanceMat
=
measure
Conditional
matCooc
distanceMap
=
Map
.
filter
(
>
threshold
)
$
mat2map
distanceMat
...
...
@@ -60,7 +60,7 @@ cooc2graph threshold myCooc = do
(
ti
,
_
)
=
createIndices
myCooc
myCooc'
=
toIndex
ti
myCooc
matCooc
=
map2mat
0
(
Map
.
size
ti
)
$
Map
.
filter
(
>
1
)
myCooc'
distanceMat
=
measureConditional
matCooc
distanceMat
=
measure
Conditional
matCooc
distanceMap
=
Map
.
filter
(
>
threshold
)
$
mat2map
distanceMat
nodesApprox
::
Int
...
...
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