rust-ml / linfa

A Rust machine learning framework.
Apache License 2.0
3.75k stars 245 forks source link

PCA works only for f64 #232

Open jorgehermo9 opened 2 years ago

jorgehermo9 commented 2 years ago

PCA algorithm is only implemented for f64. Is there a reason for this? Can't it be implemented for trait Float?

EricTulowetzke commented 2 years ago

I can take look at this over the next few days if no one else wants too

bytesnake commented 2 years ago

Depends on https://github.com/rust-ndarray/ndarray-linalg/pull/275, this is already possible in the native Rust implementation but for fast LAPACK not yet

YuhanLiin commented 2 years ago

While the f32 impl would be broken when we use LAPACK, by default we use the pure-Rust linalg library instead, so f32 should work. I'll see if I can enable f32 for the pure-Rust library only without too much copypaste.