pub struct FactorAnalysis<F> { /* private fields */ }Expand description
Factor Analysis configuration.
Calling Fit::fit fits the EM algorithm and returns a
FittedFactorAnalysis.
§Type Parameters
F: The floating-point scalar type.
Implementations§
Source§impl<F: Float + Send + Sync + 'static> FactorAnalysis<F>
impl<F: Float + Send + Sync + 'static> FactorAnalysis<F>
Sourcepub fn new(n_components: usize) -> Self
pub fn new(n_components: usize) -> Self
Create a new FactorAnalysis with n_components factors.
Defaults: max_iter = 1000, tol = 1e-3, no fixed random seed.
Sourcepub fn with_max_iter(self, max_iter: usize) -> Self
pub fn with_max_iter(self, max_iter: usize) -> Self
Set the maximum number of EM iterations.
Sourcepub fn with_random_state(self, seed: u64) -> Self
pub fn with_random_state(self, seed: u64) -> Self
Set the random seed for reproducibility.
Sourcepub fn n_components(&self) -> usize
pub fn n_components(&self) -> usize
Return the number of latent factors.
Trait Implementations§
Source§impl<F: Clone> Clone for FactorAnalysis<F>
impl<F: Clone> Clone for FactorAnalysis<F>
Source§fn clone(&self) -> FactorAnalysis<F>
fn clone(&self) -> FactorAnalysis<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Debug> Debug for FactorAnalysis<F>
impl<F: Debug> Debug for FactorAnalysis<F>
Source§impl<F: Float + Send + Sync + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ()> for FactorAnalysis<F>
impl<F: Float + Send + Sync + 'static> Fit<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ()> for FactorAnalysis<F>
Source§fn fit(
&self,
x: &Array2<F>,
_y: &(),
) -> Result<FittedFactorAnalysis<F>, FerroError>
fn fit( &self, x: &Array2<F>, _y: &(), ) -> Result<FittedFactorAnalysis<F>, FerroError>
Fit the Factor Analysis model using the EM algorithm.
§Errors
FerroError::InvalidParameterifn_componentsis zero or exceedsn_features.FerroError::InsufficientSamplesif fewer than 2 samples are provided.
Source§type Fitted = FittedFactorAnalysis<F>
type Fitted = FittedFactorAnalysis<F>
The fitted model type returned by
fit.Source§type Error = FerroError
type Error = FerroError
The error type returned by
fit.Source§impl<F: Float + Send + Sync + 'static> PipelineTransformer<F> for FactorAnalysis<F>
impl<F: Float + Send + Sync + 'static> PipelineTransformer<F> for FactorAnalysis<F>
Source§fn fit_pipeline(
&self,
x: &Array2<F>,
_y: &Array1<F>,
) -> Result<Box<dyn FittedPipelineTransformer<F>>, FerroError>
fn fit_pipeline( &self, x: &Array2<F>, _y: &Array1<F>, ) -> Result<Box<dyn FittedPipelineTransformer<F>>, FerroError>
Auto Trait Implementations§
impl<F> Freeze for FactorAnalysis<F>
impl<F> RefUnwindSafe for FactorAnalysis<F>where
F: RefUnwindSafe,
impl<F> Send for FactorAnalysis<F>where
F: Send,
impl<F> Sync for FactorAnalysis<F>where
F: Sync,
impl<F> Unpin for FactorAnalysis<F>where
F: Unpin,
impl<F> UnsafeUnpin for FactorAnalysis<F>
impl<F> UnwindSafe for FactorAnalysis<F>where
F: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more