MeanStdevScaler

class mastml.preprocessing.MeanStdevScaler(mean=0, stdev=1, as_frame=False)[source]

Bases: BasePreprocessor

Class designed to normalize input data to a specified mean and standard deviation

Args:

mean: (int/float), specified normalized mean of the data

stdev: (int/float), specified normalized standard deviation of the data

Methods:
fit: Obtains initial mean and stdev of data
Args:

df: (dataframe), dataframe of values to be normalized

Returns:

(self, the object instance)

transform: Normalizes the data to new mean and stdev values
Args:

df: (dataframe), dataframe of values to be normalized

Returns:

(dataframe), dataframe containing re-normalized data and any data that wasn’t normalized

inverse_transform: Un-normalizes the data to the old mean and stdev values
Args:

df: (dataframe), dataframe of values to be un-normalized

Returns:

(dataframe), dataframe containing un-normalized data and any data that wasn’t normalized

Methods Summary

fit_transform(X[, y])

Fit to data, then transform it.

Methods Documentation

fit_transform(X, y=None, **fit_params)[source]

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters

Xarray-like of shape (n_samples, n_features)

Input samples.

yarray-like of shape (n_samples,) or (n_samples, n_outputs), default=None

Target values (None for unsupervised transformations).

**fit_paramsdict

Additional fit parameters.

Returns

X_newndarray array of shape (n_samples, n_features_new)

Transformed array.