Merge branch 'master' of ssh://gonito.net/geval

This commit is contained in:
Filip Graliński 2019-02-14 16:26:19 +01:00
commit 4b85c4c1bb
6 changed files with 27 additions and 18 deletions

View File

@ -53,7 +53,7 @@ If you see a message like this:
compiler at the preprocessing stage. In this case you can re-run configure compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages. with the verbosity flag -v3 to see the error messages.
It means that you need to install lzma library on your operating it means that you need to install lzma library on your operating
system. The same might go for pkg-config. On macOS (it's more likely system. The same might go for pkg-config. On macOS (it's more likely
to happen on macOS, as these packages are usually installed out of box on Linux), you need to run: to happen on macOS, as these packages are usually installed out of box on Linux), you need to run:
@ -68,6 +68,13 @@ to happen on macOS, as these packages are usually installed out of box on Linux)
chmod u+x geval chmod u+x geval
./geval --help ./geval --help
If this binary does not work on your Linux (likely to happen on Arch Linux), try another one:
wget https://gonito.net/get/bin/geval-alt
mv geval-alt geval
chmod u+x geval
./geval --help
## Quick tour ## Quick tour
Let's use GEval to evaluate machine translation (MT) systems (but keep Let's use GEval to evaluate machine translation (MT) systems (but keep

View File

@ -1,5 +1,5 @@
name: geval name: geval
version: 1.15.0.0 version: 1.15.0.1
synopsis: Machine learning evaluation tools synopsis: Machine learning evaluation tools
description: Please see README.md description: Please see README.md
homepage: http://github.com/name/project homepage: http://github.com/name/project

View File

@ -560,7 +560,7 @@ gevalCore' MAE _ = gevalCoreWithoutInput outParser outParser itemAbsoluteError a
gevalCore' SMAPE _ = gevalCoreWithoutInput outParser outParser smape averageC (* 100.0) gevalCore' SMAPE _ = gevalCoreWithoutInput outParser outParser smape averageC (* 100.0)
where outParser = getValue . TR.double where outParser = getValue . TR.double
smape (exp, out) = (abs (exp-out)) / ((abs exp) + (abs out)) smape (exp, out) = (abs (exp-out)) `safeDoubleDiv` ((abs exp) + (abs out))
gevalCore' Pearson _ = gevalCoreByCorrelationMeasure pearson gevalCore' Pearson _ = gevalCoreByCorrelationMeasure pearson
gevalCore' Spearman _ = gevalCoreByCorrelationMeasure spearman gevalCore' Spearman _ = gevalCoreByCorrelationMeasure spearman

View File

@ -86,7 +86,7 @@ main = hspec $ do
runGEvalTest "mae-simple" `shouldReturnAlmost` 1.5 runGEvalTest "mae-simple" `shouldReturnAlmost` 1.5
describe "SMAPE" $ do describe "SMAPE" $ do
it "simple test" $ it "simple test" $
runGEvalTest "smape-simple" `shouldReturnAlmost` 54.2222222222222222 runGEvalTest "smape-simple" `shouldReturnAlmost` 45.1851851851852
describe "Spearman's rank correlation coefficient" $ do describe "Spearman's rank correlation coefficient" $ do
it "simple test" $ do it "simple test" $ do
runGEvalTest "spearman-simple" `shouldReturnAlmost` (- 0.5735) runGEvalTest "spearman-simple" `shouldReturnAlmost` (- 0.5735)

View File

@ -3,3 +3,4 @@
-2.5 -2.5
3 3
0.3 0.3
0.0

1 1.1
3 -2.5
4 3
5 0.3
6 0.0

View File

@ -3,3 +3,4 @@
0.0 0.0
3 3
1.2 1.2
0.0

1 -2.5
3 0.0
4 3
5 1.2
6 0.0