diff --git a/src/linalg/evd.rs b/src/linalg/evd.rs index 78b6cc2..81e2315 100644 --- a/src/linalg/evd.rs +++ b/src/linalg/evd.rs @@ -93,7 +93,7 @@ pub trait EVDDecomposableMatrix: BaseMatrix { sort(&mut d, &mut e, &mut V); } - Ok(EVD { V, d, e }) + Ok(EVD { d, e, V }) } } diff --git a/src/linalg/ndarray_bindings.rs b/src/linalg/ndarray_bindings.rs index 0aa97aa..e081dcc 100644 --- a/src/linalg/ndarray_bindings.rs +++ b/src/linalg/ndarray_bindings.rs @@ -966,7 +966,7 @@ mod tests { let error: f64 = y .into_iter() .zip(y_hat.into_iter()) - .map(|(&a, &b)| (a - b).abs()) + .map(|(a, b)| (a - b).abs()) .sum(); assert!(error <= 1.0); diff --git a/src/naive_bayes/categorical.rs b/src/naive_bayes/categorical.rs index 51619b6..44e5dd9 100644 --- a/src/naive_bayes/categorical.rs +++ b/src/naive_bayes/categorical.rs @@ -232,8 +232,8 @@ impl CategoricalNBDistribution { class_labels, class_priors, coefficients, - n_categories, n_features, + n_categories, category_count, }) } diff --git a/src/preprocessing/series_encoder.rs b/src/preprocessing/series_encoder.rs index 2cd4133..ab99b08 100644 --- a/src/preprocessing/series_encoder.rs +++ b/src/preprocessing/series_encoder.rs @@ -134,10 +134,8 @@ where U: RealNumber, V: BaseVector, { - match self.get_num(category) { - None => None, - Some(&idx) => Some(make_one_hot::(idx, self.num_categories)), - } + self.get_num(category) + .map(|&idx| make_one_hot::(idx, self.num_categories)) } /// Invert one-hot vector, back to the category