Added additional doctest and fixed indices (#141)

This commit is contained in:
Chris McComb
2022-08-12 17:38:13 -04:00
committed by morenol
parent 98e3465e7b
commit eb4b49d552
6 changed files with 22 additions and 9 deletions
+2 -2
View File
@@ -285,7 +285,7 @@ impl<'a, T: RealNumber, M: Matrix<T>> NodeVisitor<'a, T, M> {
}
}
pub(in crate) fn which_max(x: &[usize]) -> usize {
pub(crate) fn which_max(x: &[usize]) -> usize {
let mut m = x[0];
let mut which = 0;
@@ -421,7 +421,7 @@ impl<T: RealNumber> DecisionTreeClassifier<T> {
Ok(result.to_row_vector())
}
pub(in crate) fn predict_for_row<M: Matrix<T>>(&self, x: &M, row: usize) -> usize {
pub(crate) fn predict_for_row<M: Matrix<T>>(&self, x: &M, row: usize) -> usize {
let mut result = 0;
let mut queue: LinkedList<usize> = LinkedList::new();