fix: fixes a bug in decision_tree_regressor

This commit is contained in:
Volodymyr Orlov
2020-03-26 16:21:20 -07:00
parent 02b85415d9
commit 4d967858a5
3 changed files with 80 additions and 5 deletions
+3
View File
@@ -137,6 +137,9 @@ impl<T: FloatExt + Debug> BaseMatrix<T> for DenseMatrix<T> {
}
fn get(&self, row: usize, col: usize) -> T {
if row >= self.nrows || col >= self.ncols {
panic!("Invalid index ({},{}) for {}x{} matrix", row, col, self.nrows, self.ncols);
}
self.values[col*self.nrows + row]
}