From 995beb6dbc18c72ff00ccf69e61faa3b270868d2 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sat, 12 Dec 2015 08:14:13 +0100 Subject: [PATCH] handle metric ordering --- geval.cabal | 2 +- src/GEval/Core.hs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/geval.cabal b/geval.cabal index e9acd33..8e7827f 100644 --- a/geval.cabal +++ b/geval.cabal @@ -1,5 +1,5 @@ name: geval -version: 0.2.0.0 +version: 0.2.1.0 synopsis: Machine learning evaluation tools description: Please see README.md homepage: http://github.com/name/project diff --git a/src/GEval/Core.hs b/src/GEval/Core.hs index 527d15e..fabeb10 100644 --- a/src/GEval/Core.hs +++ b/src/GEval/Core.hs @@ -40,6 +40,14 @@ type MetricValue = Double data Metric = RMSE | MSE | BLEU | Accuracy deriving (Show, Read) +data MetricOrdering = TheLowerTheBetter | TheHigherTheBetter + +getMetricOrdering :: Metric -> MetricOrdering +getMetricOrdering RMSE = TheLowerTheBetter +getMetricOrdering MSE = TheLowerTheBetter +getMetricOrdering BLEU = TheHigherTheBetter +getMetricOrdering Accuracy = TheHigherTheBetter + defaultOutDirectory = "." defaultTestName = "test-A" defaultOutFile = "out.tsv"