fix: fixes a bug in decision_tree_regressor
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user