Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
22b6aa97
Commit
22b6aa97
authored
Mar 29, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] clustering, order 2 similarity, ok
parent
badfdf60
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+11
-2
No files found.
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
22b6aa97
...
...
@@ -9,6 +9,8 @@ Portability : POSIX
-}
{-# LANGUAGE ScopedTypeVariables #-}
module
Gargantext.Core.Viz.Graph.Tools
where
...
...
@@ -78,7 +80,8 @@ cooc2graphWith' :: ToComId a
cooc2graphWith'
doPartitions
distance
threshold
myCooc
=
do
let
-- TODO remove below
theMatrix
=
Map
.
fromList
$
HashMap
.
toList
myCooc
theMatrix
=
Map
.
fromList
$
HashMap
.
toList
myCooc
(
ti
,
_
)
=
createIndices
theMatrix
myCooc'
=
toIndex
ti
theMatrix
...
...
@@ -99,7 +102,13 @@ cooc2graphWith' doPartitions distance threshold myCooc = do
printDebug
"Similarities"
similarities
let
distanceMap
=
case
distance
of
links
=
round
(
let
n
::
Double
=
fromIntegral
(
Map
.
size
ti
)
in
n
*
log
n
)
distanceMap
=
Map
.
fromList
$
List
.
take
links
$
List
.
sortOn
snd
$
Map
.
toList
$
case
distance
of
Conditional
->
Map
.
filter
(
>
threshold
)
Distributional
->
Map
.
filter
(
>
0
)
$
mat2map
similarities
...
...
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