feat: adds accuracy, recall and precision metrics

This commit is contained in:
Volodymyr Orlov
2020-06-05 17:39:29 -07:00
parent e20e9ca6e0
commit c0c2029f2c
10 changed files with 285 additions and 8 deletions
+2 -1
View File
@@ -273,6 +273,7 @@ mod tests {
use super::*;
use crate::linalg::naive::dense_matrix::*;
use ndarray::{arr1, arr2, Array1};
use crate::metrics::*;
#[test]
fn multiclass_objective_f() {
@@ -447,7 +448,7 @@ mod tests {
let lr = LogisticRegression::fit(&x, &y);
let y_hat = lr.predict(&x);
let y_hat = lr.predict(&x);
let error: f64 = y.into_iter().zip(y_hat.into_iter()).map(|(&a, &b)| (a - b).abs()).sum();