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
c8240f5f
Unverified
Commit
c8240f5f
authored
Jun 11, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ElEve..
parent
4ca92b8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
Eleve.hs
src/Gargantext/Text/Eleve.hs
+4
-15
No files found.
src/Gargantext/Text/Eleve.hs
View file @
c8240f5f
...
@@ -200,22 +200,11 @@ entropyTrie pred (Node c () children) = Node c e (map (entropyTrie pred) childre
...
@@ -200,22 +200,11 @@ entropyTrie pred (Node c () children) = Node c e (map (entropyTrie pred) childre
where
where
chc
=
fromIntegral
(
_node_count
child
)
/
fromIntegral
c
chc
=
fromIntegral
(
_node_count
child
)
/
fromIntegral
c
------------------------------------------------------------------------
------------------------------------------------------------------------
normalizeLevel
::
Entropy
e
=>
[
e
]
->
e
->
e
normalizeLevel
::
Entropy
e
=>
e
->
[
e
]
->
e
->
e
normalizeLevel
=
checkDiff
(
go
.
noNaNs
)
normalizeLevel
prev
=
go
.
noNaNs
where
where
-- checkDiff f es e = let e' = f es e in if e == e' then e' else trace ("normalizeLevel: diff " <> show e <> " " <> show e') e'
go
es
=
\
e
->
((
e
-
prev
)
-
m
)
/
v
checkDiff
=
identity
-- go [] = panic "normalizeLevel: impossible"
-- trace "normalizeLevel"
-- go [_] = identity
go
es
=
\
e
->
(
e
-
m
)
/
v
{-
in if P.isNaN e'
then trace ("normalizeLevel " <> show (e,m,v,es))
e
else e'
-}
where
where
m
=
mean
es
m
=
mean
es
v
=
deviation
es
v
=
deviation
es
...
@@ -261,7 +250,7 @@ normalizeEntropy inE modE t = go (modE identity) level t
...
@@ -261,7 +250,7 @@ normalizeEntropy inE modE t = go (modE identity) level t
-- go _ ([] : _) _ = panic "normalizeEntropy': empty level"
-- go _ ([] : _) _ = panic "normalizeEntropy': empty level"
go
f
(
es
:
ess
)
(
Node
c
i
children
)
go
f
(
es
:
ess
)
(
Node
c
i
children
)
-- | any (sim (i ^. inE)) es
-- | any (sim (i ^. inE)) es
=
Node
c
(
f
i
)
$
go
(
modE
$
normalizeLevel
es
)
ess
<$>
children
=
Node
c
(
f
i
)
$
go
(
modE
$
normalizeLevel
(
i
^.
inE
)
es
)
ess
<$>
children
-- | otherwise
-- | otherwise
-- = panic "NOT an elem"
-- = panic "NOT an elem"
...
...
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