2 Module : Gargantext.Core.Statistics
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
13 module Gargantext.Core.Statistics
18 import Gargantext.Prelude
19 import Numeric.Statistics.PCA (pcaReduceN)
20 import Data.Array.IArray (Array, listArray, elems)
21 import qualified Data.Vector.Storable as Vec
22 import qualified Data.List as List
23 import qualified Data.Map as Map
26 data Dimension = Dimension Int
30 -> Map t (Vec.Vector Double)
31 -> Map t (Vec.Vector Double)
32 pcaReduceTo (Dimension d) m = Map.fromList
37 m'' :: Array Int (Vec.Vector Double)
38 m'' = listArray (1, List.length m') m'
40 (txts,m') = List.unzip $ Map.toList m