项目作者: dmarkham

项目描述 :
Computes F1 Scores
高级语言: Go
项目地址: git://github.com/dmarkham/f1.git
创建时间: 2019-02-21T17:40:58Z
项目社区:https://github.com/dmarkham/f1

开源协议:MIT License

下载


F1

Simple data structure to computes F1 scores.

https://en.wikipedia.org/wiki/F1_score

Build Status
GoDoc

Install

go get github.com/dmarkham/f1

Example

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/dmarkham/f1"
  5. )
  6. func main() {
  7. f := f1.New()
  8. f.TruePositive++ // Correct Positive
  9. fmt.Println(f.Score(1)) // perfect score of 1
  10. f.TrueNegative++ // Correct Negative
  11. fmt.Println(f.Score(1)) // Still a perfect score
  12. f.Type1Error++ // False Positive
  13. fmt.Println(f.Score(1)) // Now the score goes down
  14. f.Type2Error++ // False Negative
  15. fmt.Println(f.Score(1)) // Now the score goes down even more
  16. }