Open
Description
Maybe this isn't the correct place to ask or maybe I just need a fresh pair of eyes but I'm having trouble using the ndarray-linalg svd function.
the following code throws and error at the unwrap()
X : &ArrayBase<impl Data<Elem = f64>, Ix2>,
) -> Array2<f64> {
let temp:Array2<f64> = X.to_owned().clone();
let (u, s, v) = temp.svd(true, true).unwrap();
while the following does not
x : &ArrayBase<impl Data<Elem = f64>, Ix2>,
n_components : f64,
) -> Self {
let (_n, _m) = x.dim();
//calculate the array of columnar means
let mean = x.mean_axis(Axis(0)).unwrap();
// subtract means from X
let h:Array2<f64> = Array2::ones((_n, _m));
let temp:Array2<f64> = h * &mean;
let b:Array2<f64> = x - &temp;
// compute SVD
let (u, sigma, v) = b.svd(true, true).unwrap();
any help would be appreciated
Metadata
Metadata
Assignees
Labels
No labels