sklearn.preprocessing#

Methods for scaling, centering, normalization, binarization, and more.

User guide. See the Preprocessing data section for further details.

Binarizer

Binarize data (set feature values to 0 or 1) according to a threshold.

FunctionTransformer

Constructs a transformer from an arbitrary callable.

KBinsDiscretizer

Bin continuous data into intervals.

KernelCenterer

Center an arbitrary kernel matrix \(K\).

LabelBinarizer

Binarize labels in a one-vs-all fashion.

LabelEncoder

Encode target labels with value between 0 and n_classes-1.

MaxAbsScaler

Scale each feature by its maximum absolute value.

MinMaxScaler

Transform features by scaling each feature to a given range.

MultiLabelBinarizer

Transform between iterable of iterables and a multilabel format.

Normalizer

Normalize samples individually to unit norm.

OneHotEncoder

Encode categorical features as a one-hot numeric array.

OrdinalEncoder

Encode categorical features as an integer array.

PolynomialFeatures

Generate polynomial and interaction features.

PowerTransformer

Apply a power transform featurewise to make data more Gaussian-like.

QuantileTransformer

Transform features using quantiles information.

RobustScaler

Scale features using statistics that are robust to outliers.

SplineTransformer

Generate univariate B-spline bases for features.

StandardScaler

Standardize features by removing the mean and scaling to unit variance.

TargetEncoder

Target Encoder for regression and classification targets.

add_dummy_feature

Augment dataset with an additional dummy feature.

binarize

Boolean thresholding of array-like or scipy.sparse matrix.

label_binarize

Binarize labels in a one-vs-all fashion.

maxabs_scale

Scale each feature to the [-1, 1] range without breaking the sparsity.

minmax_scale

Transform features by scaling each feature to a given range.

normalize

Scale input vectors individually to unit norm (vector length).

power_transform

Parametric, monotonic transformation to make data more Gaussian-like.

quantile_transform

Transform features using quantiles information.

robust_scale

Standardize a dataset along any axis.

scale

Standardize a dataset along any axis.