We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80a973b commit b807674Copy full SHA for b807674
algorithms/linfa-reduction/src/pca.rs
@@ -190,6 +190,14 @@ impl Pca<f64> {
190
pub fn singular_values(&self) -> &Array1<f64> {
191
&self.sigma
192
}
193
+
194
+ /// Transform data back to its original space
195
+ pub fn inverse_transform(
196
+ &self,
197
+ prediction: ArrayBase<ndarray::OwnedRepr<f64>, ndarray::Dim<[usize; 2]>>,
198
+ ) -> ArrayBase<ndarray::OwnedRepr<f64>, ndarray::Dim<[usize; 2]>> {
199
+ prediction.dot(&self.embedding) + &self.mean
200
+ }
201
202
203
impl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Ix2>, Array2<F>> for Pca<F> {
0 commit comments