Struct rusty_machine::data::transforms::shuffle::Shuffler [] [src]

pub struct Shuffler<R: Rng> { /* fields omitted */ }

The Shuffler

Provides an implementation of Transformer which shuffles the input rows in place.

Methods

impl<R: Rng> Shuffler<R>
[src]

Construct a new Shuffler with given random number generator.

Examples


use rusty_machine::data::transforms::Transformer;
use rusty_machine::data::transforms::shuffle::Shuffler;
use rand::{StdRng, SeedableRng};

// We can create a seeded rng
let rng = StdRng::from_seed(&[1, 2, 3]);

let shuffler = Shuffler::new(rng);

Trait Implementations

impl<R: Debug + Rng> Debug for Shuffler<R>
[src]

Formats the value using the given formatter.

impl Default for Shuffler<ThreadRng>
[src]

Create a new shuffler using the rand::thread_rng function to provide a randomly seeded random number generator.

Returns the "default value" for a type. Read more

impl<R: Rng, T> Transformer<Matrix<T>> for Shuffler<R>
[src]

The Shuffler will transform the input Matrix by shuffling its rows in place.

Under the hood this uses a Fisher-Yates shuffle.

Fit Transformer to input data, and stores the transformation in the Transformer

Transforms the inputs and stores the transformation in the Transformer