Struct rustml::datasets::NormalData
[−]
[src]
pub struct NormalData { // some fields omitted }
Generates multi-dimensional data where each dimension is normally distributed.
Example
use rustml::datasets::*; let seed = [1, 2, 3, 4]; // create 2-dimensional vectors where the values of the first // component are normal distributed with the parameters // mu = 1.0 and std = 0.5 and the values of the second component // are normal distributed with the parameters mu = 2.0 and // std = 0.8. let nd = normal_builder(seed) .add(1.0, 0.5) // parameters for the 1st dimension .add(2.0, 0.8); // parameters for the 2nd dimension for v in nd.take(100) { // do s.th. assert_eq!(v.len(), 2); }
Methods
impl NormalData
fn add(&self, mean: f64, std: f64) -> NormalData
Adds a dimension for which the data is normally distributed with the given parameters.
fn len(&self) -> usize
Returns the number of dimensions added via the add
method.