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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
4a8e3c73
Commit
4a8e3c73
authored
Oct 10, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REBASE]
parent
a6aaf952
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
63 additions
and
65 deletions
+63
-65
package.yaml
package.yaml
+1
-1
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+6
-5
Update.hs
src/Gargantext/API/Node/Update.hs
+1
-1
MaxClique.hs
src/Gargantext/Core/Methods/Graph/MaxClique.hs
+3
-3
Similarities.hs
src/Gargantext/Core/Methods/Similarities.hs
+8
-8
Conditional.hs
...ntext/Core/Methods/Similarities/Accelerate/Conditional.hs
+3
-3
Distributional.hs
...xt/Core/Methods/Similarities/Accelerate/Distributional.hs
+3
-3
SpeGen.hs
...Gargantext/Core/Methods/Similarities/Accelerate/SpeGen.hs
+2
-2
Conditional.hs
src/Gargantext/Core/Methods/Similarities/Conditional.hs
+2
-2
Distributional.hs
src/Gargantext/Core/Methods/Similarities/Distributional.hs
+2
-2
Metrics.hs
src/Gargantext/Core/Text/Metrics.hs
+1
-1
CharByChar.hs
src/Gargantext/Core/Text/Metrics/CharByChar.hs
+2
-2
Graph.hs
src/Gargantext/Core/Viz/Graph.hs
+1
-1
API.hs
src/Gargantext/Core/Viz/Graph/API.hs
+13
-16
Index.hs
src/Gargantext/Core/Viz/Graph/Index.hs
+1
-1
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+11
-11
PhyloMaker.hs
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
+1
-1
SynchronicClustering.hs
src/Gargantext/Core/Viz/Phylo/SynchronicClustering.hs
+2
-2
No files found.
package.yaml
View file @
4a8e3c73
...
...
@@ -70,7 +70,7 @@ library:
-
Gargantext.API.Prelude
-
Gargantext.Core
-
Gargantext.Core.NodeStory
-
Gargantext.Core.Methods.
Distanc
es
-
Gargantext.Core.Methods.
Similariti
es
-
Gargantext.Core.Types
-
Gargantext.Core.Types.Individu
-
Gargantext.Core.Types.Main
...
...
src/Gargantext/API/Ngrams/Tools.hs
View file @
4a8e3c73
...
...
@@ -187,11 +187,12 @@ getCoocByNgrams' f (Diagonal diag) m =
<$>
(
fmap
f
$
HM
.
lookup
t1
m
)
<*>
(
fmap
f
$
HM
.
lookup
t2
m
)
)
|
(
t1
,
t2
)
<-
if
diag
then
[
(
x
,
y
)
|
x
<-
ks
,
y
<-
ks
,
x
<=
y
]
-- TODO if we keep a Data.Map here it might be
-- more efficient to enumerate all the y <= x.
else
listToCombi
identity
ks
|
(
t1
,
t2
)
<-
if
diag
then
[
(
x
,
y
)
|
x
<-
ks
,
y
<-
ks
,
x
<=
y
]
-- TODO if we keep a Data.Map here it might be
-- more efficient to enumerate all the y <= x.
else
listToCombi
identity
ks
]
where
ks
=
HM
.
keys
m
...
...
src/Gargantext/API/Node/Update.hs
View file @
4a8e3c73
...
...
@@ -27,7 +27,7 @@ import Gargantext.API.Admin.Types (HasSettings)
import
Gargantext.API.Ngrams.List
(
reIndexWith
)
--import Gargantext.API.Ngrams.Types (TabType(..))
import
Gargantext.API.Prelude
(
GargM
,
GargError
,
simuLogs
)
import
Gargantext.Core.Methods.
Distanc
es
(
GraphMetric
(
..
))
import
Gargantext.Core.Methods.
Similariti
es
(
GraphMetric
(
..
))
import
Gargantext.Core.Types.Main
(
ListType
(
..
))
import
Gargantext.Core.Viz.Graph
(
Strength
)
import
Gargantext.Core.Viz.Graph.API
(
recomputeGraph
)
...
...
src/Gargantext/Core/Methods/Graph/MaxClique.hs
View file @
4a8e3c73
...
...
@@ -62,7 +62,7 @@ import Data.Set (fromList, toList, isSubsetOf)
import
Data.Graph.Inductive
hiding
(
Graph
,
neighbors
,
subgraph
,
(
&
))
import
Gargantext.Core.Viz.Graph.FGL
(
Graph_Undirected
,
degree
,
neighbors
,
mkGraphUfromEdges
)
import
Gargantext.Core.Viz.Graph.Tools
(
cooc2graph'
,
cooc2graph''
,
Threshold
)
import
Gargantext.Core.Methods.
Distances
(
Distance
)
import
Gargantext.Core.Methods.
Similarities
(
Similarity
)
import
Gargantext.Core.Viz.Graph.Index
(
createIndices
,
toIndex
)
import
Gargantext.Core.Viz.Phylo
-- import Debug.Trace (trace)
...
...
@@ -70,9 +70,9 @@ type Graph = Graph_Undirected
type
Neighbor
=
Node
-- | getMaxCliques
-- TODO chose
distance
order
-- TODO chose
similarity
order
getMaxCliques
::
Ord
a
=>
MaxCliqueFilter
->
Distance
->
Threshold
->
Map
(
a
,
a
)
Int
->
[[
a
]]
getMaxCliques
::
Ord
a
=>
MaxCliqueFilter
->
Similarity
->
Threshold
->
Map
(
a
,
a
)
Int
->
[[
a
]]
getMaxCliques
f
d
t
m
=
map
fromIndices
$
getMaxCliques'
t
m'
where
m'
=
toIndex
to
m
...
...
src/Gargantext/Core/Methods/
Distanc
es.hs
→
src/Gargantext/Core/Methods/
Similariti
es.hs
View file @
4a8e3c73
{-|
Module : Gargantext.Graph.
Distanc
es
Description :
Distance
management tools
Module : Gargantext.Graph.
Similariti
es
Description :
Similarity
management tools
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
...
...
@@ -11,32 +11,32 @@ Portability : POSIX
{-# LANGUAGE Strict #-}
module
Gargantext.Core.Methods.
Distanc
es
module
Gargantext.Core.Methods.
Similariti
es
where
import
Data.Aeson
import
Data.Array.Accelerate
(
Matrix
)
import
Data.Swagger
import
GHC.Generics
(
Generic
)
import
Gargantext.Core.Methods.
Distanc
es.Accelerate.Conditional
(
measureConditional
)
import
Gargantext.Core.Methods.
Distanc
es.Accelerate.Distributional
(
logDistributional
)
import
Gargantext.Core.Methods.
Similariti
es.Accelerate.Conditional
(
measureConditional
)
import
Gargantext.Core.Methods.
Similariti
es.Accelerate.Distributional
(
logDistributional
)
import
Gargantext.Prelude
(
Ord
,
Eq
,
Int
,
Double
,
Show
)
import
Prelude
(
Enum
,
Bounded
,
minBound
,
maxBound
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
------------------------------------------------------------------------
data
Distance
=
Conditional
|
Distributional
data
Similarity
=
Conditional
|
Distributional
deriving
(
Show
,
Eq
)
measure
::
Distance
->
Matrix
Int
->
Matrix
Double
measure
::
Similarity
->
Matrix
Int
->
Matrix
Double
measure
Conditional
x
=
measureConditional
x
measure
Distributional
x
=
y
where
y
=
logDistributional
x
------------------------------------------------------------------------
withMetric
::
GraphMetric
->
Distance
withMetric
::
GraphMetric
->
Similarity
withMetric
Order1
=
Conditional
withMetric
Order2
=
Distributional
...
...
src/Gargantext/Core/Methods/
Distanc
es/Accelerate/Conditional.hs
→
src/Gargantext/Core/Methods/
Similariti
es/Accelerate/Conditional.hs
View file @
4a8e3c73
{-|
Module : Gargantext.Core.Methods.
Distanc
es.Accelerate.Conditional
Module : Gargantext.Core.Methods.
Similariti
es.Accelerate.Conditional
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
@@ -20,7 +20,7 @@ See Gargantext.Core.Methods.Graph.Accelerate)
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
module
Gargantext.Core.Methods.
Distanc
es.Accelerate.Conditional
module
Gargantext.Core.Methods.
Similariti
es.Accelerate.Conditional
where
-- import qualified Data.Foldable as P (foldl1)
...
...
@@ -28,7 +28,7 @@ module Gargantext.Core.Methods.Distances.Accelerate.Conditional
import
Data.Array.Accelerate
import
Data.Array.Accelerate.Interpreter
(
run
)
import
Gargantext.Core.Methods.Matrix.Accelerate.Utils
import
Gargantext.Core.Methods.
Distanc
es.Accelerate.SpeGen
import
Gargantext.Core.Methods.
Similariti
es.Accelerate.SpeGen
import
qualified
Gargantext.Prelude
as
P
...
...
src/Gargantext/Core/Methods/
Distanc
es/Accelerate/Distributional.hs
→
src/Gargantext/Core/Methods/
Similariti
es/Accelerate/Distributional.hs
View file @
4a8e3c73
{-|
Module : Gargantext.Core.Methods.
Distanc
es.Accelerate.Distributional
Module : Gargantext.Core.Methods.
Similariti
es.Accelerate.Distributional
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
@@ -8,7 +8,7 @@ Stability : experimental
Portability : POSIX
* Distributional
Distance
metric
* Distributional
Similarity
metric
__Definition :__ Distributional metric is a relative metric which depends on the
selected list, it represents structural equivalence of mutual information.
...
...
@@ -41,7 +41,7 @@ where $n_{ij}$ is the cooccurrence between term $i$ and term $j$
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE GADTs #-}
module
Gargantext.Core.Methods.
Distanc
es.Accelerate.Distributional
module
Gargantext.Core.Methods.
Similariti
es.Accelerate.Distributional
where
-- import qualified Data.Foldable as P (foldl1)
...
...
src/Gargantext/Core/Methods/
Distanc
es/Accelerate/SpeGen.hs
→
src/Gargantext/Core/Methods/
Similariti
es/Accelerate/SpeGen.hs
View file @
4a8e3c73
{-|
Module : Gargantext.Core.Methods.
Distanc
es.Accelerate.SpeGen
Module : Gargantext.Core.Methods.
Similariti
es.Accelerate.SpeGen
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
@@ -20,7 +20,7 @@ See Gargantext.Core.Methods.Graph.Accelerate)
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ViewPatterns #-}
module
Gargantext.Core.Methods.
Distanc
es.Accelerate.SpeGen
module
Gargantext.Core.Methods.
Similariti
es.Accelerate.SpeGen
where
-- import qualified Data.Foldable as P (foldl1)
...
...
src/Gargantext/Core/Methods/
Distanc
es/Conditional.hs
→
src/Gargantext/Core/Methods/
Similariti
es/Conditional.hs
View file @
4a8e3c73
{-|
Module : Gargantext.Core.Methods.
Distanc
es
Module : Gargantext.Core.Methods.
Similariti
es
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
@@ -12,7 +12,7 @@ Motivation and definition of the @Conditional@ distance.
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE Strict #-}
module
Gargantext.Core.Methods.
Distanc
es.Conditional
module
Gargantext.Core.Methods.
Similariti
es.Conditional
where
import
Control.DeepSeq
(
NFData
)
...
...
src/Gargantext/Core/Methods/
Distanc
es/Distributional.hs
→
src/Gargantext/Core/Methods/
Similariti
es/Distributional.hs
View file @
4a8e3c73
{-|
Module : Gargantext.Core.Methods.
Distanc
es.Distributional
Module : Gargantext.Core.Methods.
Similariti
es.Distributional
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
@@ -14,7 +14,7 @@ Motivation and definition of the @Distributional@ distance.
{-# LANGUAGE Strict #-}
module
Gargantext.Core.Methods.
Distanc
es.Distributional
module
Gargantext.Core.Methods.
Similariti
es.Distributional
where
import
Data.Matrix
hiding
(
identity
)
...
...
src/Gargantext/Core/Text/Metrics.hs
View file @
4a8e3c73
...
...
@@ -23,7 +23,7 @@ import Data.Map (Map)
import
Data.Monoid
(
Monoid
,
mempty
)
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Semigroup
(
Semigroup
)
import
Gargantext.Core.Methods.
Distanc
es.Accelerate.SpeGen
import
Gargantext.Core.Methods.
Similariti
es.Accelerate.SpeGen
import
Gargantext.Core.Statistics
(
pcaReduceTo
,
Dimension
(
..
))
import
Gargantext.Core.Viz.Graph.Index
import
Gargantext.Prelude
...
...
src/Gargantext/Core/Text/Metrics/CharByChar.hs
View file @
4a8e3c73
...
...
@@ -39,7 +39,7 @@ import Gargantext.Prelude
-- starting as an API rexporting main functions of the great lib
-- text-metrics of Mark Karpov
-- | Levenshtein
Distance
-- | Levenshtein
Similarity
-- In information theory, Linguistics and computer science,
-- the Levenshtein distance is a string metric for measuring
-- the difference between two sequences.
...
...
@@ -86,7 +86,7 @@ overlap = DTM.overlap
jaccard
::
Text
->
Text
->
Ratio
Int
jaccard
=
DTM
.
jaccard
-- | Hamming
Distance
-- | Hamming
Similarity
-- In information theory, the Hamming distance between two strings of
-- equal length is the number of positions at which the corresponding
-- symbols are different. In other words, it measures the minimum number of
...
...
src/Gargantext/Core/Viz/Graph.hs
View file @
4a8e3c73
...
...
@@ -25,7 +25,7 @@ import qualified Data.Text as T
import
qualified
Text.Read
as
T
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
),
NgramsRepoElement
(
..
),
mSetToList
)
import
Gargantext.Core.Methods.
Distanc
es
(
GraphMetric
)
import
Gargantext.Core.Methods.
Similariti
es
(
GraphMetric
)
import
Gargantext.Core.Types
(
ListId
)
import
Gargantext.Database.Admin.Types.Hyperdata.Prelude
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
...
...
src/Gargantext/Core/Viz/Graph/API.hs
View file @
4a8e3c73
...
...
@@ -27,7 +27,7 @@ import Gargantext.API.Admin.EnvTypes (GargJob(..), Env)
import
Gargantext.API.Admin.Orchestrator.Types
import
Gargantext.API.Ngrams.Tools
import
Gargantext.API.Prelude
import
Gargantext.Core.Methods.
Distances
(
Distance
(
..
),
GraphMetric
(
..
),
withMetric
)
import
Gargantext.Core.Methods.
Similarities
(
Similarity
(
..
),
GraphMetric
(
..
),
withMetric
)
import
Gargantext.Core.NodeStory
import
Gargantext.Core.Types.Main
import
Gargantext.Core.Viz.Graph
...
...
@@ -101,7 +101,7 @@ getGraph _uId nId = do
listId
<-
defaultList
cId
repo
<-
getRepo
[
listId
]
-- TODO
Distance
in Graph params
-- TODO
Similarity
in Graph params
case
graph
of
Nothing
->
do
let
defaultMetric
=
Order1
...
...
@@ -129,16 +129,16 @@ recomputeGraph :: FlowCmdM env err m
->
Maybe
Strength
->
Bool
->
m
Graph
recomputeGraph
_uId
nId
method
maybe
Distance
maybeStrength
force
=
do
recomputeGraph
_uId
nId
method
maybe
Similarity
maybeStrength
force
=
do
nodeGraph
<-
getNodeWith
nId
(
Proxy
::
Proxy
HyperdataGraph
)
let
graph
=
nodeGraph
^.
node_hyperdata
.
hyperdataGraph
camera
=
nodeGraph
^.
node_hyperdata
.
hyperdataCamera
graphMetadata
=
graph
^?
_Just
.
graph_metadata
.
_Just
listVersion
=
graph
^?
_Just
.
graph_metadata
.
_Just
.
gm_list
.
lfg_version
graphMetric
=
case
maybe
Distance
of
graphMetric
=
case
maybe
Similarity
of
Nothing
->
graph
^?
_Just
.
graph_metadata
.
_Just
.
gm_metric
_
->
maybe
Distance
_
->
maybe
Similarity
similarity
=
case
graphMetric
of
Nothing
->
withMetric
Order1
Just
m
->
withMetric
m
...
...
@@ -164,7 +164,7 @@ recomputeGraph _uId nId method maybeDistance maybeStrength force = do
case
graph
of
Nothing
->
do
mt
<-
defaultGraphMetadata
cId
"Title"
repo
(
fromMaybe
Order1
maybe
Distance
)
strength
mt
<-
defaultGraphMetadata
cId
"Title"
repo
(
fromMaybe
Order1
maybe
Similarity
)
strength
g
<-
computeG
$
Just
mt
pure
$
trace
"[G.V.G.API.recomputeGraph] Graph empty, computed"
g
Just
graph'
->
if
(
listVersion
==
Just
v
)
&&
(
not
force
)
...
...
@@ -177,27 +177,24 @@ recomputeGraph _uId nId method maybeDistance maybeStrength force = do
computeGraph
::
FlowCmdM
env
err
m
=>
CorpusId
->
PartitionMethod
->
Distance
->
Similarity
->
Strength
->
NgramsType
->
NodeListStory
->
m
Graph
computeGraph
c
Id
method
d
strength
nt
repo
=
do
lId
<-
defaultList
cId
computeGraph
c
orpusId
method
similarity
strength
nt
repo
=
do
lId
<-
defaultList
c
orpus
Id
lIds
<-
selectNodesWithUsername
NodeList
userMaster
let
ngs
=
filterListWithRoot
[
MapTerm
]
$
mapTermListRoot
[
lId
]
nt
repo
!
myCooc
<-
HashMap
.
filter
(
>
1
)
-- Removing the hapax (ngrams with 1 cooc)
-- Removing the hapax (ngrams with 1 cooc)
!
myCooc
<-
HashMap
.
filter
(
>
1
)
<$>
getCoocByNgrams
(
Diagonal
True
)
<$>
groupNodesByNgrams
ngs
<$>
getContextsByNgramsOnlyUser
cId
(
lIds
<>
[
lId
])
nt
(
HashMap
.
keys
ngs
)
graph
<-
liftBase
$
cooc2graphWith
method
d
0
strength
myCooc
<$>
getContextsByNgramsOnlyUser
corpusId
(
lIds
<>
[
lId
])
nt
(
HashMap
.
keys
ngs
)
--listNgrams <- getListNgrams [lId] nt
--let graph' = mergeGraphNgrams graph (Just listNgrams)
-- saveAsFileDebug "/tmp/graphWithNodes" graph'
graph
<-
liftBase
$
cooc2graphWith
method
similarity
0
strength
myCooc
pure
graph
...
...
src/Gargantext/Core/Viz/Graph/Index.hs
View file @
4a8e3c73
{-|
Module : Gargantext.Graph.
Distanc
es.Utils
Module : Gargantext.Graph.
Similariti
es.Utils
Description : Tools to compute distances from Cooccurrences
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
...
...
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
4a8e3c73
...
...
@@ -22,8 +22,8 @@ import Data.Swagger hiding (items)
import
GHC.Float
(
sin
,
cos
)
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Ngrams.Types
(
NgramsTerm
(
..
))
import
Gargantext.Core.Methods.
Distances
(
Distance
(
..
),
measure
)
import
Gargantext.Core.Methods.
Distanc
es.Conditional
(
conditional
)
import
Gargantext.Core.Methods.
Similarities
(
Similarity
(
..
),
measure
)
import
Gargantext.Core.Methods.
Similariti
es.Conditional
(
conditional
)
import
Gargantext.Core.Statistics
import
Gargantext.Core.Viz.Graph
import
Gargantext.Core.Viz.Graph.Bridgeness
(
bridgeness
,
Partitions
,
ToComId
(
..
))
...
...
@@ -65,7 +65,7 @@ defaultClustering x = spinglass 1 x
type
Threshold
=
Double
cooc2graph'
::
Ord
t
=>
Distance
cooc2graph'
::
Ord
t
=>
Similarity
->
Double
->
Map
(
t
,
t
)
Int
->
Map
(
Index
,
Index
)
Double
...
...
@@ -87,7 +87,7 @@ cooc2graph' distance threshold myCooc
-- coocurrences graph computation
cooc2graphWith
::
PartitionMethod
->
Distance
->
Similarity
->
Threshold
->
Strength
->
HashMap
(
NgramsTerm
,
NgramsTerm
)
Int
...
...
@@ -100,13 +100,13 @@ cooc2graphWith Infomap = cooc2graphWith' (infomap "--silent --two-level -N2")
cooc2graphWith'
::
ToComId
a
=>
Partitions
a
->
Distance
->
Similarity
->
Threshold
->
Strength
->
HashMap
(
NgramsTerm
,
NgramsTerm
)
Int
->
IO
Graph
cooc2graphWith'
doPartitions
distance
threshold
strength
myCooc
=
do
let
(
distanceMap
,
diag
,
ti
)
=
do
DistanceMap
distance
threshold
strength
myCooc
cooc2graphWith'
doPartitions
similarity
threshold
strength
myCooc
=
do
let
(
distanceMap
,
diag
,
ti
)
=
do
SimilarityMap
similarity
threshold
strength
myCooc
distanceMap
`
seq
`
diag
`
seq
`
ti
`
seq
`
return
()
--{- -- Debug
...
...
@@ -134,7 +134,7 @@ cooc2graphWith' doPartitions distance threshold strength myCooc = do
type
Reverse
=
Bool
do
DistanceMap
::
Distance
do
SimilarityMap
::
Similarity
->
Threshold
->
Strength
->
HashMap
(
NgramsTerm
,
NgramsTerm
)
Int
...
...
@@ -142,7 +142,7 @@ doDistanceMap :: Distance
,
Map
(
Index
,
Index
)
Int
,
Map
NgramsTerm
Index
)
do
Distance
Map
Distributional
threshold
strength
myCooc
=
(
distanceMap
,
toIndex
ti
diag
,
ti
)
do
Similarity
Map
Distributional
threshold
strength
myCooc
=
(
distanceMap
,
toIndex
ti
diag
,
ti
)
where
-- TODO remove below
(
diag
,
theMatrix
)
=
Map
.
partitionWithKey
(
\
(
x
,
y
)
_
->
x
==
y
)
...
...
@@ -168,7 +168,7 @@ doDistanceMap Distributional threshold strength myCooc = (distanceMap, toIndex t
$
(
\
m
->
m
`
seq
`
Map
.
filter
(
>
threshold
)
m
)
$
similarities
`
seq
`
mat2map
similarities
do
Distance
Map
Conditional
threshold
strength
myCooc
=
(
distanceMap
,
toIndex
ti
myCooc'
,
ti
)
do
Similarity
Map
Conditional
threshold
strength
myCooc
=
(
distanceMap
,
toIndex
ti
myCooc'
,
ti
)
where
myCooc'
=
Map
.
fromList
$
HashMap
.
toList
myCooc
(
ti
,
_it
)
=
createIndices
myCooc'
...
...
@@ -302,7 +302,7 @@ layout m n gen = maybe (panic "") identity $ Map.lookup n $ coord
-----------------------------------------------------------------------------
-- MISC Tools
cooc2graph''
::
Ord
t
=>
Distance
cooc2graph''
::
Ord
t
=>
Similarity
->
Double
->
Map
(
t
,
t
)
Int
->
Map
(
Index
,
Index
)
Double
...
...
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
View file @
4a8e3c73
...
...
@@ -21,7 +21,7 @@ import Data.Vector (Vector)
import
Debug.Trace
(
trace
)
import
Prelude
(
floor
)
import
Gargantext.Core.Methods.
Distances
(
Distance
(
Conditional
))
import
Gargantext.Core.Methods.
Similarities
(
Similarity
(
Conditional
))
import
Gargantext.Core.Methods.Graph.MaxClique
(
getMaxCliques
)
import
Gargantext.Core.Text.Context
(
TermList
)
import
Gargantext.Core.Text.Metrics.FrequentItemSet
(
fisWithSizePolyMap
,
fisWithSizePolyMap'
,
Size
(
..
))
...
...
src/Gargantext/Core/Viz/Phylo/SynchronicClustering.hs
View file @
4a8e3c73
...
...
@@ -210,8 +210,8 @@ synchronicClustering phylo =
in
toNextScale
phylo
$
levelUpAncestors
$
concat
newBranches'
-- synchronic
Distance
:: Phylo -> Level -> String
-- synchronic
Distance
phylo lvl =
-- synchronic
Similarity
:: Phylo -> Level -> String
-- synchronic
Similarity
phylo lvl =
-- foldl' (\acc branch ->
-- acc <> (foldl' (\acc' period ->
-- acc' <> let prox = phyloProximity $ getConfig phylo
...
...
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