Commit 958e43fb authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Distances] Conditional clearer

parent a7462f0c
......@@ -46,10 +46,10 @@ import qualified Gargantext.Prelude as P
-- Conditional metric is an absolute metric which reflects
-- interactions of 2 terms in the corpus.
measureConditional :: Matrix Int -> Matrix Double
--measureConditional m = run (matMiniMax $ matProba (dim m) $ map fromIntegral $ use m)
measureConditional m = run $ matProba (dim m)
$ map fromIntegral
$ use m
measureConditional m = run $ zipWith (/) m' (matSumCol d m')
where
m' = map fromIntegral (use m)
d = dim m
-- *** Conditional distance (advanced)
......
......@@ -108,7 +108,7 @@ matSumCol' m = run $ matSumCol n m'
-- 0.3333333333333333, 0.3333333333333333, 0.3333333333333333,
-- 0.5833333333333334, 0.5333333333333333, 0.5]
matProba :: Dim -> Acc (Matrix Double) -> Acc (Matrix Double)
matProba r mat = zipWith (/) mat (matSumCol r mat)
matProba d mat = zipWith (/) mat (matSumCol d mat)
-- | Diagonal of the matrix
--
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment