Preprocessing#

Scalers, encoders, imputers and discretizers.

BernoulliNB

Naive Bayes classifier for binary features.

Binarizer

Set feature values to 0 or 1 by a threshold.

CategoricalNB

Naive Bayes classifier for categorical features.

chi2

Compute chi-squared statistics between each nonnegative feature and the class labels.

ComplementNB

Complement naive Bayes classifier, suited to imbalanced text data.

f_classif

Compute the ANOVA F-value of each feature against the class labels.

f_regression

Compute the F-statistic of each feature's correlation with a continuous target.

GaussianNB

Gaussian naive Bayes classifier.

IterativeImputer

Impute missing values by modeling each feature from the others, round by round.

KBinsDiscretizer

Bin continuous features into intervals.

LabelBinarizer

Binarize labels in a one-vs-all fashion.

LabelEncoder

Encode target labels as integers 0 to n_classes - 1.

LinearDiscriminantAnalysis

Linear discriminant analysis classifier and supervised dimensionality reduction.

MaxAbsScaler

Scale each feature by its maximum absolute value.

MinMaxScaler

Scale each feature to a given range.

MultiLabelBinarizer

Convert sets of labels to a binary indicator matrix.

MultinomialNB

Naive Bayes classifier for multinomial (count) features.

mutual_info_classif

Estimate the mutual information between each feature and a discrete target.

mutual_info_regression

Estimate the mutual information between each feature and a continuous target.

Normalizer

Scale each row to unit norm.

OneHotEncoder

Encode numeric categorical features as one-hot columns.

OrdinalEncoder

Encode numeric categorical features as integer codes.

PolynomialFeatures

Generate polynomial and interaction features.

PowerTransformer

Apply a power transform per feature to make the data more Gaussian.

preprocessing

Feature scaling: StandardScaler and MinMaxScaler.

QuadraticDiscriminantAnalysis

Quadratic discriminant analysis classifier.

QuantileTransformer

Map each feature to a uniform or normal distribution through its quantiles.

r_regression

Compute the Pearson correlation of each feature with a continuous target.

RFE

Feature ranking with recursive feature elimination.

RobustScaler

Scale features by the median and the interquantile range.

SelectKBest

Select the features with the k highest scores.

SimpleImputer

Replace missing values with a per-column statistic.

SplineTransformer

Generate B-spline basis features for each feature.

StandardScaler

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

TargetEncoder

Encode numeric categorical features by the target mean of each category.

VarianceThreshold

Feature selector that removes low-variance features.