flow_dimensional_reduction/pca/
state.rs1use super::PcaComponent;
9
10#[derive(Debug, Clone, Copy)]
12pub struct Unfitted {
13 pub(super) n_components: usize,
14}
15
16impl super::sealed::Sealed for Unfitted {}
17
18impl PcaComponent for Unfitted {
19 fn n_components(&self) -> usize {
20 self.n_components
21 }
22}
23
24#[derive(Debug, Clone)]
26pub struct Fitted {
27 pub(super) n_components: usize,
28 pub(super) components: Vec<f32>,
30 pub(super) explained_variance_ratio: Vec<f32>,
31 pub(super) mean: Vec<f32>,
32}
33
34impl super::sealed::Sealed for Fitted {}
35
36impl PcaComponent for Fitted {
37 fn n_components(&self) -> usize {
38 self.n_components
39 }
40}