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
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
Christian Merten
haskell-gargantext
Commits
f169660f
Commit
f169660f
authored
Mar 28, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DOC] Cosmetics + TODO.
parent
531be4ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
Learn.hs
src/Gargantext/Text/List/Learn.hs
+11
-8
No files found.
src/Gargantext/Text/List/Learn.hs
View file @
f169660f
...
...
@@ -17,16 +17,16 @@ CSV parser for Gargantext corpus files.
module
Gargantext.Text.List.Learn
where
import
Data.Map
(
Map
)
import
Data.Maybe
(
maybe
)
import
GHC.IO
(
FilePath
)
import
qualified
Data.SVM
as
SVM
import
Gargantext.Prelude
import
Data.Map
(
Map
)
import
Gargantext.Core.Types.Main
(
ListType
(
..
),
listTypeId
,
fromListTypeId
)
import
Gargantext.Prelude
import
Gargantext.Text.Metrics.Count
(
occurrencesWith
)
import
qualified
Data.IntMap
as
IntMap
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.
IntMap
as
IntMap
import
qualified
Data.
SVM
as
SVM
import
qualified
Data.Vector
as
Vec
------------------------------------------------------------------------
...
...
@@ -63,7 +63,10 @@ load :: FilePath -> IO SVM.Model
load
=
SVM
.
loadModel
------------------------------------------------------------------------
-- | TODO
-- shuffle list
-- split list : train / test
-- grid parameters on best result on test
grid
::
Map
ListType
[
Vec
.
Vector
Double
]
->
IO
()
-- Map (ListType, Maybe ListType) Int)
grid
m
=
do
let
...
...
@@ -91,11 +94,11 @@ grid m = do
where
total
=
fromIntegral
$
foldl
(
+
)
0
$
Map
.
elems
m''
r
<-
List
.
take
10
<$>
List
.
reverse
<$>
List
.
sortOn
fst
<$>
mapM
(
\
(
x
,
y
)
->
grid'
x
y
m
)
[(
x
,
y
)
|
x
<-
[
500
..
600
],
y
<-
[
500
..
600
]]
r
<-
List
.
take
10
<$>
List
.
reverse
<$>
List
.
sortOn
fst
<$>
mapM
(
\
(
x
,
y
)
->
grid'
x
y
m
)
[(
x
,
y
)
|
x
<-
[
500
..
600
],
y
<-
[
500
..
600
]]
printDebug
"GRID SEARCH"
r
-- save best result
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