[][src]Struct petal_decomposition::FastIca

pub struct FastIca<A, R = Pcg> where
    A: Scalar,
    R: Rng
{ /* fields omitted */ }

Independent component analysis using the FastICA algorithm.

Examples

use petal_decomposition::FastIca;

let x = ndarray::arr2(&[[0_f64, 0_f64], [1_f64, 1_f64], [1_f64, -1_f64]]);
let mut ica = FastIca::new();
let y = ica.fit_transform(&x).unwrap();

Implementations

impl<A> FastIca<A, Pcg> where
    A: Scalar + Lapack
[src]

#[must_use]pub fn new() -> Self[src]

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.

#[must_use]pub fn with_seed(seed: u128) -> Self[src]

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.

impl<A, R> FastIca<A, R> where
    A: Scalar + Lapack,
    R: Rng
[src]

#[must_use]pub fn with_rng(rng: R) -> Self[src]

Creates an ICA model with the given random number generator.

pub fn fit<S>(
    &mut self,
    input: &ArrayBase<S, Ix2>
) -> Result<(), DecompositionError> where
    S: Data<Elem = A>, 
[src]

Fits the model with input.

Errors

  • DecompositionError::LinalgError if the underlying Singular Vector Decomposition routine fails.

pub fn transform<S>(
    &self,
    input: &ArrayBase<S, Ix2>
) -> Result<Array2<A>, DecompositionError> where
    S: Data<Elem = A>, 
[src]

Applies ICA to input.

Errors

  • DecompositionError::InvalidInput if the number of features in input does not match that of the training data.

pub fn fit_transform<S>(
    &mut self,
    input: &ArrayBase<S, Ix2>
) -> Result<Array2<A>, DecompositionError> where
    S: Data<Elem = A>, 
[src]

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

Returns DecompositionError::LinalgError if the underlying Singular Vector Decomposition routine fails.

Trait Implementations

impl<A> Default for FastIca<A, Pcg> where
    A: Scalar + Lapack
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,