Standardizer

Struct Standardizer 

Source
pub struct Standardizer<T: Float> { /* private fields */ }
Expand description

The Standardizer

The Standardizer provides an implementation of Transformer which allows us to transform the input data to have a new mean and standard deviation.

See the module description for more information.

Implementations§

Source§

impl<T: Float> Standardizer<T>

Source

pub fn new(mean: T, stdev: T) -> Standardizer<T>

Constructs a new Standardizer with the given mean and variance

§Examples
use rusty_machine::data::transforms::Standardizer;

// Constructs a new `Standardizer` which will give the data
// mean `0` and standard deviation `2`.
let transformer = Standardizer::new(0.0, 2.0);

Trait Implementations§

Source§

impl<T: Debug + Float> Debug for Standardizer<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Float> Default for Standardizer<T>

Create a Standardizer with mean 0 and standard deviation 1.

Source§

fn default() -> Standardizer<T>

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

impl<T: Float + FromPrimitive> Invertible<Matrix<T>> for Standardizer<T>

Source§

fn inv_transform(&self, inputs: Matrix<T>) -> Result<Matrix<T>, Error>

Maps the inputs using the inverse of the fitted transform.
Source§

impl<T: Float + FromPrimitive> Transformer<Matrix<T>> for Standardizer<T>

Source§

fn fit(&mut self, inputs: &Matrix<T>) -> Result<(), Error>

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

fn transform(&mut self, inputs: Matrix<T>) -> Result<Matrix<T>, Error>

Transforms the inputs and stores the transformation in the Transformer

Auto Trait Implementations§

§

impl<T> Freeze for Standardizer<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Standardizer<T>
where T: RefUnwindSafe,

§

impl<T> Send for Standardizer<T>
where T: Send,

§

impl<T> Sync for Standardizer<T>
where T: Sync,

§

impl<T> Unpin for Standardizer<T>
where T: Unpin,

§

impl<T> UnwindSafe for Standardizer<T>
where T: 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, 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.