fix: ridge regression, formatting

This commit is contained in:
Volodymyr Orlov
2020-11-11 12:01:57 -08:00
parent ca3a3a101c
commit 7a4fe114d8
+1 -5
View File
@@ -69,7 +69,6 @@ pub trait MatrixStats<T: RealNumber>: BaseMatrix<T> {
/// Computes the standard deviation along the specified axis. /// Computes the standard deviation along the specified axis.
fn std(&self, axis: u8) -> Vec<T> { fn std(&self, axis: u8) -> Vec<T> {
let mut x = self.var(axis); let mut x = self.var(axis);
let n = match axis { let n = match axis {
@@ -141,10 +140,7 @@ mod tests {
#[test] #[test]
fn var() { fn var() {
let m = DenseMatrix::from_2d_array(&[ let m = DenseMatrix::from_2d_array(&[&[1., 2., 3., 4.], &[5., 6., 7., 8.]]);
&[1., 2., 3., 4.],
&[5., 6., 7., 8.]
]);
let expected_0 = vec![4., 4., 4., 4.]; let expected_0 = vec![4., 4., 4., 4.];
let expected_1 = vec![1.25, 1.25]; let expected_1 = vec![1.25, 1.25];