improvements in challenge creation
This commit is contained in:
parent
e10f92cf9c
commit
5098225bc1
@ -1,5 +1,5 @@
|
||||
name: geval
|
||||
version: 1.2.3.0
|
||||
version: 1.3.0.0
|
||||
synopsis: Machine learning evaluation tools
|
||||
description: Please see README.md
|
||||
homepage: http://github.com/name/project
|
||||
|
@ -14,20 +14,28 @@ import Control.Exception
|
||||
import Control.Monad.Trans.Resource
|
||||
import Data.String.Here
|
||||
|
||||
createChallenge :: FilePath -> GEvalSpecification -> IO ()
|
||||
createChallenge expectedDirectory spec = do
|
||||
createChallenge :: Bool -> FilePath -> GEvalSpecification -> IO ()
|
||||
createChallenge withDataFiles expectedDirectory spec = do
|
||||
D.createDirectoryIfMissing False expectedDirectory
|
||||
D.createDirectoryIfMissing False trainDirectory
|
||||
D.createDirectoryIfMissing False devDirectory
|
||||
D.createDirectoryIfMissing False testDirectory
|
||||
createFile (expectedDirectory </> ".gitignore") $ gitignoreContents
|
||||
createFile (expectedDirectory </> "README.md") $ readmeMDContents metric testName
|
||||
createFile (expectedDirectory </> configFileName) $ configContents metrics precision testName
|
||||
D.createDirectoryIfMissing False trainDirectory
|
||||
if withDataFiles
|
||||
then
|
||||
do
|
||||
createFile (trainDirectory </> "train.tsv") $ trainContents metric
|
||||
D.createDirectoryIfMissing False devDirectory
|
||||
|
||||
createFile (devDirectory </> "in.tsv") $ devInContents metric
|
||||
createFile (devDirectory </> "expected.tsv") $ devExpectedContents metric
|
||||
D.createDirectoryIfMissing False testDirectory
|
||||
createFile (devDirectory </> expectedFile) $ devExpectedContents metric
|
||||
|
||||
createFile (testDirectory </> "in.tsv") $ testInContents metric
|
||||
createFile (testDirectory </> expectedFile) $ testExpectedContents metric
|
||||
createFile (expectedDirectory </> ".gitignore") $ gitignoreContents
|
||||
|
||||
else
|
||||
return ()
|
||||
where metric = gesMainMetric spec
|
||||
metrics = gesMetrics spec
|
||||
precision = gesPrecision spec
|
||||
@ -564,4 +572,11 @@ testExpectedContents _ = [hereLit|0.11
|
||||
|]
|
||||
|
||||
gitignoreContents :: String
|
||||
gitignoreContents = "*~\n"
|
||||
gitignoreContents = [hereLit|
|
||||
*~
|
||||
*.swp
|
||||
*.bak
|
||||
*.pyc
|
||||
*.o
|
||||
.DS_Store
|
||||
|]
|
||||
|
@ -4,7 +4,9 @@ module GEval.OptionsParser
|
||||
(fullOptionsParser,
|
||||
runGEval,
|
||||
runGEvalGetOptions,
|
||||
getOptions) where
|
||||
getOptions,
|
||||
metricReader
|
||||
) where
|
||||
|
||||
import Paths_geval (version)
|
||||
import Data.Version (showVersion)
|
||||
@ -218,7 +220,7 @@ runGEval''' (Just (MostWorseningFeatures otherOut)) ordering spec = do
|
||||
initChallenge :: GEvalSpecification -> IO ()
|
||||
initChallenge spec = case gesExpectedDirectory spec of
|
||||
Nothing -> showInitInstructions
|
||||
Just expectedDirectory -> createChallenge expectedDirectory spec
|
||||
Just expectedDirectory -> createChallenge True expectedDirectory spec
|
||||
|
||||
showInitInstructions = do
|
||||
putStrLn [here|
|
||||
|
Loading…
Reference in New Issue
Block a user