demo.rs 396 B

1234567891011121314151617
  1. use confusion_matrix;
  2. fn main() {
  3. let mut cm = confusion_matrix::new();
  4. cm[("pos", "pos")] = 10;
  5. cm[("pos", "neg")] = 5;
  6. cm[("neg", "neg")] = 20;
  7. cm[("neg", "pos")] = 3;
  8. println!("Precision: {}", cm.precision("pos"));
  9. println!("Recall: {}", cm.recall("pos"));
  10. println!("MCC: {}", cm.matthews_correlation("pos"));
  11. println!("");
  12. println!("{}", cm);
  13. }