petal_decomposition

Struct FastIcaBuilder

Source
pub struct FastIcaBuilder<R> { /* private fields */ }
Expand description

Builder for FastIca.

§Examples

use petal_decomposition::FastIcaBuilder;

let x = ndarray::arr2(&[[0_f64, 0_f64], [1_f64, 1_f64]]);
let mut ica = FastIcaBuilder::new().build();
ica.fit(&x);

Implementations§

Source§

impl FastIcaBuilder<Mcg128Xsl64>

Source

pub fn new() -> Self

Sets the number of components for PCA.

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.

Source

pub fn seed(self, seed: u128) -> Self

Initialized the PCG random number genernator with the given seed.

§Examples
use petal_decomposition::FastIcaBuilder;

let x = ndarray::arr2(&[[0_f64, 0_f64], [1_f64, 1_f64]]);
let mut ica = FastIcaBuilder::new().seed(1234567891011121314).build();
ica.fit(&x);
Source§

impl<R: Rng> FastIcaBuilder<R>

Source

pub fn with_rng(rng: R) -> Self

Sets the random number generator for FastICA.

§Examples
use petal_decomposition::FastIcaBuilder;
use rand_pcg::Pcg64;

let x = ndarray::arr2(&[[0_f64, 0_f64], [1_f64, 1_f64]]);
let rng = Pcg64::new(0xcafef00dd15ea5e5, 0xa02bdbf7bb3c0a7ac28fa16a64abf96);
let mut ica = FastIcaBuilder::with_rng(rng).build();
ica.fit(&x);
Source

pub fn build<A: Scalar>(self) -> FastIca<A, R>

Creates an instance of FastIca.

Trait Implementations§

Source§

impl Default for FastIcaBuilder<Mcg128Xsl64>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<R> Freeze for FastIcaBuilder<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for FastIcaBuilder<R>
where R: RefUnwindSafe,

§

impl<R> Send for FastIcaBuilder<R>
where R: Send,

§

impl<R> Sync for FastIcaBuilder<R>
where R: Sync,

§

impl<R> Unpin for FastIcaBuilder<R>
where R: Unpin,

§

impl<R> UnwindSafe for FastIcaBuilder<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V