Implement predict_proba for DecisionTreeClassifier (#287)

* Implement predict_proba for DecisionTreeClassifier
* Some automated fixes suggested by cargo clippy --fix
This commit is contained in:
Lorenzo
2025-01-20 18:50:00 +00:00
committed by GitHub
parent 4523ac73ff
commit 3da433f757
13 changed files with 166 additions and 61 deletions
+8 -12
View File
@@ -172,18 +172,14 @@ where
T: Number + RealNumber,
M: Array2<T>,
{
if let Some(output_matrix) = columns.first().cloned() {
return Some(
columns
.iter()
.skip(1)
.fold(output_matrix, |current_matrix, new_colum| {
current_matrix.h_stack(new_colum)
}),
);
} else {
None
}
columns.first().cloned().map(|output_matrix| {
columns
.iter()
.skip(1)
.fold(output_matrix, |current_matrix, new_colum| {
current_matrix.h_stack(new_colum)
})
})
}
#[cfg(test)]