metrics-test.scm 713 B

12345678910111213141516171819202122232425262728293031
  1. (use-modules
  2. ;; SRFI 64 for unit testing facilities
  3. (srfi srfi-64)
  4. ;; Dependencies for testing the code to be tested
  5. (metrics))
  6. (test-begin "metrics-test")
  7. (test-group
  8. "accuracy-metric"
  9. (test-equal (accuracy-metric (list 0 0 0 0)
  10. (list 1 0 0 0))
  11. 3/4)
  12. (test-equal (accuracy-metric (list 0 0 0 0)
  13. (list 1 1 0 0))
  14. 1/2)
  15. (test-equal (accuracy-metric (list 1 1 1 1)
  16. (list 1 0 0 0))
  17. 1/4)
  18. (test-equal (accuracy-metric (list 0 0 0 0)
  19. (list 0 0 0 0))
  20. 1)
  21. (test-equal (accuracy-metric (list 0 0 0)
  22. (list 1 0 0))
  23. 2/3))
  24. (test-end "metrics-test")