pub struct Pca { /* private fields */ }Expand description
Implementations§
Source§impl Pca
impl Pca
Sourcepub fn new(data: Array2<f64>) -> Self
pub fn new(data: Array2<f64>) -> Self
A PCA on data (an nobs × nvar matrix) with the reference defaults:
standardized columns, all components, normalized factors.
Sourcepub fn ncomp(self, ncomp: usize) -> Self
pub fn ncomp(self, ncomp: usize) -> Self
Set the number of components to retain. Defaults to min(nobs, nvar).
Sourcepub fn standardize(self, standardize: bool) -> Self
pub fn standardize(self, standardize: bool) -> Self
Whether to standardize each column to unit variance (population, ddof 0)
before decomposition. When true, this implies demeaning. Default true.
Sourcepub fn demean(self, demean: bool) -> Self
pub fn demean(self, demean: bool) -> Self
Whether to subtract each column’s mean before decomposition. Ignored when
standardize is true (standardizing already demeans). Default true.
Sourcepub fn normalize(self, normalize: bool) -> Self
pub fn normalize(self, normalize: bool) -> Self
Whether to normalize the factors to unit inner product, scaling the
coefficients by sqrt(eigenvalue). Default true.
Sourcepub fn fit(&self) -> Result<PcaResults>
pub fn fit(&self) -> Result<PcaResults>
Estimate the PCA via SVD.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pca
impl RefUnwindSafe for Pca
impl Send for Pca
impl Sync for Pca
impl Unpin for Pca
impl UnsafeUnpin for Pca
impl UnwindSafe for Pca
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more