Soft2D-F... Metric is inclusive now.
This commit is contained in:
parent
5f9d2b85c7
commit
029e3880f7
@ -104,11 +104,13 @@ rectangleParser = do
|
|||||||
x1 <- decimal
|
x1 <- decimal
|
||||||
char ','
|
char ','
|
||||||
y1 <- decimal
|
y1 <- decimal
|
||||||
return $ Rectangle (Point x0 y0) (Point x1 y1)
|
if x1 < x0 || y1 < y0
|
||||||
|
then fail "wrong coordinates"
|
||||||
|
else return $ Rectangle (Point x0 y0) (Point x1 y1)
|
||||||
|
|
||||||
rectangleArea :: Rectangle -> Integer
|
rectangleArea :: Rectangle -> Integer
|
||||||
rectangleArea (Rectangle (Point x0 y0) (Point x1 y1)) =
|
rectangleArea (Rectangle (Point x0 y0) (Point x1 y1)) =
|
||||||
(fromIntegral $ x1 - x0) * (fromIntegral $ y1 - y0)
|
(fromIntegral $ x1 - x0 + 1) * (fromIntegral $ y1 - y0 + 1)
|
||||||
|
|
||||||
clippingArea :: LabeledClipping -> Integer
|
clippingArea :: LabeledClipping -> Integer
|
||||||
clippingArea (LabeledClipping _ (Clipping _ rect)) = rectangleArea rect
|
clippingArea (LabeledClipping _ (Clipping _ rect)) = rectangleArea rect
|
||||||
|
@ -121,8 +121,8 @@ expectedScore (EvaluationScheme (SoftFMeasure beta) [])
|
|||||||
recall = 0.75
|
recall = 0.75
|
||||||
in weightedHarmonicMean beta precision recall
|
in weightedHarmonicMean beta precision recall
|
||||||
expectedScore (EvaluationScheme (Soft2DFMeasure beta) [])
|
expectedScore (EvaluationScheme (Soft2DFMeasure beta) [])
|
||||||
= let precision = 0.21117747440273
|
= let precision = 0.211622914314256
|
||||||
recall = 0.27423822714681
|
recall = 0.2749908502976
|
||||||
in (weightedHarmonicMean beta precision recall) / 2.0
|
in (weightedHarmonicMean beta precision recall) / 2.0
|
||||||
|
|
||||||
listOfAvailableEvaluationSchemes :: [EvaluationScheme]
|
listOfAvailableEvaluationSchemes :: [EvaluationScheme]
|
||||||
|
@ -276,7 +276,9 @@ main = hspec $ do
|
|||||||
runGEvalTest "probabilistic-soft-f1-calibrated" `shouldReturnAlmost` 0.88888888888
|
runGEvalTest "probabilistic-soft-f1-calibrated" `shouldReturnAlmost` 0.88888888888
|
||||||
describe "Soft2D-F1" $ do
|
describe "Soft2D-F1" $ do
|
||||||
it "simple test" $ do
|
it "simple test" $ do
|
||||||
runGEvalTest "soft2d-f1-simple" `shouldReturnAlmost` 0.218457349437945
|
runGEvalTest "soft2d-f1-simple" `shouldReturnAlmost` 0.22053934201995676
|
||||||
|
it "very narrow rectangles" $ do
|
||||||
|
runGEvalTest "soft2d-f1-one-pixel" `shouldReturnAlmost` 0.281992045358382
|
||||||
describe "test edit-distance library" $ do
|
describe "test edit-distance library" $ do
|
||||||
it "for handling UTF8" $ do
|
it "for handling UTF8" $ do
|
||||||
levenshteinDistance defaultEditCosts "źdźbło" "źd好bło" `shouldBe` 1
|
levenshteinDistance defaultEditCosts "źdźbło" "źd好bło" `shouldBe` 1
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
3/100,200,100,200
|
||||||
|
3/100,200,101,200
|
||||||
|
3/100,200,100,200
|
||||||
|
3/100,200,102,202
|
||||||
|
2/1000,2000,1000,2000 1/1000,2000,1000,2000
|
||||||
|
1/100,150,300,350
|
|
1
test/soft2d-f1-one-pixel/soft2d-f1-one-pixel/config.txt
Normal file
1
test/soft2d-f1-one-pixel/soft2d-f1-one-pixel/config.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--metric Soft2D-F1
|
@ -0,0 +1,6 @@
|
|||||||
|
3/100,200,100,400
|
||||||
|
3/100,200,101,201
|
||||||
|
3/100,200,101,201
|
||||||
|
3/100,200,101,201
|
||||||
|
3/1000,2000,1000,2000 4/1000,2000,1000,2000
|
||||||
|
2/100,150,300,350
|
|
Loading…
Reference in New Issue
Block a user