diff --git a/measure_auc.py b/measure_auc.py index 3030e1f..4478dc8 100644 --- a/measure_auc.py +++ b/measure_auc.py @@ -1,6 +1,6 @@ import pandas as pd from sklearn import metrics -scores = pd.read_csv('scores_py.csv', names=['score'])['score'] +scores = pd.read_csv('scores.csv', names=['score'])['score'] labels = pd.read_csv('creditcard.csv')['Class'] -print(f"{metrics.roc_auc_score(labels, scores):.2%}") +print(f"{metrics.roc_auc_score(labels, -scores):.2%}") diff --git a/src/main.rs b/src/main.rs index 8546925..5d2c981 100644 --- a/src/main.rs +++ b/src/main.rs @@ -233,16 +233,16 @@ fn main() { // Pivot if the window is full counter += 1; if counter == window_size { - // for tree in trees.iter_mut() { - // for node in 0..tree.l_mass.len() { - // tree.r_mass[node] = tree.l_mass[node]; - // tree.l_mass[node] = 0.0; - // } - // } - trees.iter_mut().for_each(|tree| { - tree.r_mass.copy_from_slice(&tree.l_mass); - tree.l_mass.iter_mut().for_each(|mass| *mass = 0.0); - }); + for tree in trees.iter_mut() { + for node in 0..tree.l_mass.len() { + tree.r_mass[node] = tree.l_mass[node]; + tree.l_mass[node] = 0.0; + } + } + // trees.iter_mut().for_each(|tree| { + // tree.r_mass.copy_from_slice(&tree.l_mass); + // tree.l_mass.fill(0.0); + // }); counter = 0; }