chore: fix clippy warnings
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ pub trait EVDDecomposableMatrix<T: RealNumber>: BaseMatrix<T> {
|
|||||||
sort(&mut d, &mut e, &mut V);
|
sort(&mut d, &mut e, &mut V);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(EVD { V, d, e })
|
Ok(EVD { d, e, V })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -966,7 +966,7 @@ mod tests {
|
|||||||
let error: f64 = y
|
let error: f64 = y
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.zip(y_hat.into_iter())
|
.zip(y_hat.into_iter())
|
||||||
.map(|(&a, &b)| (a - b).abs())
|
.map(|(a, b)| (a - b).abs())
|
||||||
.sum();
|
.sum();
|
||||||
|
|
||||||
assert!(error <= 1.0);
|
assert!(error <= 1.0);
|
||||||
|
|||||||
@@ -232,8 +232,8 @@ impl<T: RealNumber> CategoricalNBDistribution<T> {
|
|||||||
class_labels,
|
class_labels,
|
||||||
class_priors,
|
class_priors,
|
||||||
coefficients,
|
coefficients,
|
||||||
n_categories,
|
|
||||||
n_features,
|
n_features,
|
||||||
|
n_categories,
|
||||||
category_count,
|
category_count,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,10 +134,8 @@ where
|
|||||||
U: RealNumber,
|
U: RealNumber,
|
||||||
V: BaseVector<U>,
|
V: BaseVector<U>,
|
||||||
{
|
{
|
||||||
match self.get_num(category) {
|
self.get_num(category)
|
||||||
None => None,
|
.map(|&idx| make_one_hot::<U, V>(idx, self.num_categories))
|
||||||
Some(&idx) => Some(make_one_hot::<U, V>(idx, self.num_categories)),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Invert one-hot vector, back to the category
|
/// Invert one-hot vector, back to the category
|
||||||
|
|||||||
Reference in New Issue
Block a user