Struct petal_decomposition::FastIca
source · [−]Expand description
Implementations
sourceimpl<A> FastIca<A, Pcg> where
A: Scalar,
impl<A> FastIca<A, Pcg> where
A: Scalar,
sourcepub fn new() -> Self
pub fn new() -> Self
Creates an ICA model with a random seed.
It uses a PCG random number generator (the XSL 128/64 (MCG) variant on a 64-bit CPU and the XSH RR 64/32 (LCG) variant on a 32-bit CPU), initialized with a randomly-generated seed.
sourcepub fn with_seed(seed: u128) -> Self
pub fn with_seed(seed: u128) -> Self
Creates an ICA model with the given seed for random number generation.
It uses a PCG random number generator (the XSL 128/64 (MCG) variant on a
64-bit CPU and the XSH RR 64/32 (LCG) variant on a 32-bit CPU). Use
with_rng
for a different random number generator.
sourceimpl<A, R> FastIca<A, R> where
A: Scalar,
R: Rng,
impl<A, R> FastIca<A, R> where
A: Scalar,
R: Rng,
sourcepub fn fit<S>(
&mut self,
input: &ArrayBase<S, Ix2>
) -> Result<(), DecompositionError> where
A: Lapack,
S: Data<Elem = A>,
pub fn fit<S>(
&mut self,
input: &ArrayBase<S, Ix2>
) -> Result<(), DecompositionError> where
A: Lapack,
S: Data<Elem = A>,
Fits the model with input
.
Errors
DecompositionError::InvalidInput
if the layout ofinput
is incompatible with LAPACK.DecompositionError::LinalgError
if the underlying Singular Vector Decomposition routine fails.
sourcepub fn transform<S>(
&self,
input: &ArrayBase<S, Ix2>
) -> Result<Array2<A>, DecompositionError> where
S: Data<Elem = A>,
pub fn transform<S>(
&self,
input: &ArrayBase<S, Ix2>
) -> Result<Array2<A>, DecompositionError> where
S: Data<Elem = A>,
Applies ICA to input
.
Errors
DecompositionError::InvalidInput
if the number of features ininput
does not match that of the training data.
sourcepub fn fit_transform<S>(
&mut self,
input: &ArrayBase<S, Ix2>
) -> Result<Array2<A>, DecompositionError> where
A: Lapack,
S: Data<Elem = A>,
pub fn fit_transform<S>(
&mut self,
input: &ArrayBase<S, Ix2>
) -> Result<Array2<A>, DecompositionError> where
A: Lapack,
S: Data<Elem = A>,
Fits the model with input
and apply ICA on input
.
This is equivalent to calling both fit
and transform
for the
same input, but more efficient.
Errors
DecompositionError::InvalidInput
if the layout ofinput
is incompatible with LAPACK.DecompositionError::LinalgError
if the underlying Singular Vector Decomposition routine fails.
Trait Implementations
Auto Trait Implementations
impl<A, R> RefUnwindSafe for FastIca<A, R> where
A: RefUnwindSafe,
R: RefUnwindSafe,
impl<A, R> Send for FastIca<A, R> where
A: Send,
R: Send,
impl<A, R> Sync for FastIca<A, R> where
A: Sync,
R: Sync,
impl<A, R> Unpin for FastIca<A, R> where
R: Unpin,
impl<A, R> UnwindSafe for FastIca<A, R> where
A: RefUnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more