imblearn.pipeline.Pipeline.fit_resample

Pipeline.fit_resample(X, y=None, **fit_params)[source]

Fit the model and sample with the final estimator.

Fits all the transformers/samplers one after the other and transform/sample the data, then uses fit_resample on transformed data with the final estimator.

Parameters
Xiterable

Training data. Must fulfill input requirements of first step of the pipeline.

yiterable, default=None

Training targets. Must fulfill label requirements for all steps of the pipeline.

**fit_paramsdict of string -> object

Parameters passed to the fit method of each step, where each parameter name is prefixed such that parameter p for step s has key s__p.

Returns
Xtarray-like of shape (n_samples, n_transformed_features)

Transformed samples.

ytarray-like of shape (n_samples, n_transformed_features)

Transformed target.