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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
ab437142
Commit
ab437142
authored
May 27, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[STAT] missing file.
parent
81f6b3fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
Statistics.hs
src/Gargantext/Core/Statistics.hs
+43
-0
No files found.
src/Gargantext/Core/Statistics.hs
0 → 100644
View file @
ab437142
{-|
Module : Gargantext.Core.Statistics
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE NoImplicitPrelude #-}
module
Gargantext.Core.Statistics
where
import
Data.Map
(
Map
)
import
Gargantext.Prelude
import
Numeric.Statistics.PCA
(
pcaReduceN
)
import
Data.Array.IArray
(
Array
,
listArray
,
elems
)
import
qualified
Data.Vector.Storable
as
Vec
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
data
Dimension
=
Dimension
Int
pcaReduceTo
::
Ord
t
=>
Dimension
->
Map
t
(
Vec
.
Vector
Double
)
->
Map
t
(
Vec
.
Vector
Double
)
pcaReduceTo
(
Dimension
d
)
m
=
Map
.
fromList
$
zip
txts
$
elems
$
pcaReduceN
m''
d
where
m''
::
Array
Int
(
Vec
.
Vector
Double
)
m''
=
listArray
(
1
,
List
.
length
m'
)
m'
(
txts
,
m'
)
=
List
.
unzip
$
Map
.
toList
m
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