Skip to content

Commit 206ab98

Browse files
aswin-1111relf
andauthored
Apply suggestions from code review
Co-authored-by: Rémi Lafage <remi.lafage@onera.fr>
1 parent a8e485e commit 206ab98

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

algorithms/linfa-lars/src/algorithm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,11 @@ fn lars_path<F: Float>(
354354

355355
n_iter += 1;
356356

357-
if n_iter >= coefs.shape()[0] {
357+
if n_iter >= coefs.nrows() {
358358
let add_features = 2 * (max_features - n_active).max(1);
359359

360360
let mut new_coefs = Array2::<F>::zeros((n_iter + add_features, n_features));
361-
let old_shape = coefs.shape()[0];
361+
let old_shape = coefs.nrows();
362362
new_coefs.slice_mut(s![..old_shape, ..]).assign(&coefs);
363363

364364
coefs = new_coefs;
@@ -584,10 +584,10 @@ mod tests {
584584
let eps = 1e-3;
585585
let threshold = cap_c - eps;
586586
let ocur = cov.iter().filter(|v| v.abs() >= threshold).count();
587-
if index < x.shape()[1] {
587+
if index < x.ncols() {
588588
assert!(ocur == index + 1);
589589
} else {
590-
assert!(ocur == x.shape()[1]);
590+
assert!(ocur == x.ncols();
591591
}
592592
}
593593
}

0 commit comments

Comments
 (0)