pub struct PowerTransformer<State = Untrained> { /* private fields */ }Expand description
PowerTransformer applies power transformations to make data more Gaussian
This transformer applies power transformations to each feature to make the data more Gaussian-like, which can improve the performance of many machine learning algorithms.
Implementations§
Source§impl PowerTransformer<Untrained>
impl PowerTransformer<Untrained>
Sourcepub fn with_config(config: PowerTransformerConfig) -> Self
pub fn with_config(config: PowerTransformerConfig) -> Self
Create a new PowerTransformer with custom configuration
Sourcepub fn method(self, method: PowerMethod) -> Self
pub fn method(self, method: PowerMethod) -> Self
Set the transformation method
Sourcepub fn standardize(self, standardize: bool) -> Self
pub fn standardize(self, standardize: bool) -> Self
Set whether to standardize after transformation
Source§impl PowerTransformer<Trained>
impl PowerTransformer<Trained>
Sourcepub fn n_features_in(&self) -> usize
pub fn n_features_in(&self) -> usize
Get the number of input features
Sourcepub fn stds(&self) -> Option<&Array1<Float>>
pub fn stds(&self) -> Option<&Array1<Float>>
Get the standard deviations used for standardization
Sourcepub fn inverse_box_cox(&self, x: &Array1<Float>, lambda: Float) -> Array1<Float>
pub fn inverse_box_cox(&self, x: &Array1<Float>, lambda: Float) -> Array1<Float>
Inverse Box-Cox transformation
Trait Implementations§
Source§impl<State: Clone> Clone for PowerTransformer<State>
impl<State: Clone> Clone for PowerTransformer<State>
Source§fn clone(&self) -> PowerTransformer<State>
fn clone(&self) -> PowerTransformer<State>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<State: Debug> Debug for PowerTransformer<State>
impl<State: Debug> Debug for PowerTransformer<State>
Source§impl Default for PowerTransformer<Untrained>
impl Default for PowerTransformer<Untrained>
Source§impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ()> for PowerTransformer<Untrained>
impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ()> for PowerTransformer<Untrained>
Source§type Fitted = PowerTransformer<Trained>
type Fitted = PowerTransformer<Trained>
The fitted model type
Source§fn fit(self, x: &Array2<Float>, _y: &()) -> Result<Self::Fitted>
fn fit(self, x: &Array2<Float>, _y: &()) -> Result<Self::Fitted>
Fit the model to the provided data with validation
Source§fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping
Auto Trait Implementations§
impl<State> Freeze for PowerTransformer<State>
impl<State> RefUnwindSafe for PowerTransformer<State>where
State: RefUnwindSafe,
impl<State> Send for PowerTransformer<State>where
State: Send,
impl<State> Sync for PowerTransformer<State>where
State: Sync,
impl<State> Unpin for PowerTransformer<State>where
State: Unpin,
impl<State> UnwindSafe for PowerTransformer<State>where
State: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more