diff --git a/pca/src/main.rs b/pca/src/main.rs index c896307..e3ca0a4 100644 --- a/pca/src/main.rs +++ b/pca/src/main.rs @@ -39,7 +39,7 @@ fn cov(data: &Tensor, device: &Device) -> Result { let cov = centered .transpose(D::Minus1, D::Minus2)? .matmul(¢ered)? - .broadcast_div(&Tensor::new(m as f32, device)?)?; + .broadcast_div(&Tensor::new((m - 1) as f32, device)?)?; Ok(cov) }