Skip to content

Commit c4c78e7

Browse files
Fix warnings
1 parent 7f1a2e1 commit c4c78e7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/linear_regression.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(non_snake_case)]
12
use ndarray::{Array1, ArrayBase, Array2, stack, Axis, Array, Ix2, Data};
23
use ndarray_linalg::{Solve, random};
34
use ndarray_stats::DeviationExt;
@@ -30,7 +31,7 @@ impl LinearRegression {
3031
}
3132

3233
fn fit(&mut self, mut X: Array2<f32>, y: Array1<f32>) {
33-
let (n_samples, n_features) = X.dim();
34+
let (n_samples, _) = X.dim();
3435

3536
// Check that our inputs have compatible shapes
3637
assert_eq!(y.dim(), n_samples);
@@ -46,11 +47,11 @@ impl LinearRegression {
4647
self.beta = Some(linear_operator.solve_into(rhs).unwrap());
4748
}
4849

49-
fn predict<A>(&self, mut X: &ArrayBase<A, Ix2>) -> Array1<f32>
50+
fn predict<A>(&self, X: &ArrayBase<A, Ix2>) -> Array1<f32>
5051
where
5152
A: Data<Elem=f32>,
5253
{
53-
let (n_samples, n_features) = X.dim();
54+
let (n_samples, _) = X.dim();
5455

5556
// If we are fitting the intercept, we need an additional column
5657
let X = if self.fit_intercept {

0 commit comments

Comments
 (0)