Skip to content

Commit

Permalink
Expose references to the PCA components and column means (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishs authored Jan 13, 2024
1 parent d495562 commit 0ade794
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions algorithms/linfa-reduction/src/pca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ impl Pca<f64> {
ex_var / sum_ex_var
}

/// Return the components
pub fn components(&self) -> &Array2<f64> {
&self.embedding
}

/// Return the mean
pub fn mean(&self) -> &Array1<f64> {
&self.mean
}

/// Return the singular values
pub fn singular_values(&self) -> &Array1<f64> {
&self.sigma
Expand Down

0 comments on commit 0ade794

Please sign in to comment.