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]
fn new(rng: R) -> Self
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]
impl Default for Shuffler<ThreadRng>
[src]
Create a new shuffler using the rand::thread_rng
function
to provide a randomly seeded random number generator.
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.