Simple data structure to computes F1 scores.
https://en.wikipedia.org/wiki/F1_score
go get github.com/dmarkham/f1
package main
import (
"fmt"
"github.com/dmarkham/f1"
)
func main() {
f := f1.New()
f.TruePositive++ // Correct Positive
fmt.Println(f.Score(1)) // perfect score of 1
f.TrueNegative++ // Correct Negative
fmt.Println(f.Score(1)) // Still a perfect score
f.Type1Error++ // False Positive
fmt.Println(f.Score(1)) // Now the score goes down
f.Type2Error++ // False Negative
fmt.Println(f.Score(1)) // Now the score goes down even more
}