Struct petal_decomposition::FastIcaBuilder
source · [−]pub struct FastIcaBuilder<R> { /* private fields */ }
Expand description
Implementations
sourceimpl FastIcaBuilder<Pcg>
impl FastIcaBuilder<Pcg>
sourcepub fn new() -> Self
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.
sourcepub fn seed(self, seed: u128) -> Self
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);
sourceimpl<R: Rng> FastIcaBuilder<R>
impl<R: Rng> FastIcaBuilder<R>
sourcepub fn with_rng(rng: R) -> Self
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);
Trait Implementations
Auto Trait Implementations
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
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