简体   繁体   中英

How to add oversampling/undersampling procedure in scikit's Pipeline?

I would like to add oversampling procedure, like SMOTE oversampling , to scikit's Pipeline . But the transformers only supports fit and transform method, and do not provide a way to increase the number of samples and targets.

One possible way to do this is to break the pipeline to two separate pipelines connected by SMOTE sampling.

Is there any better solutions?

Our current Pipeline does not support changing the number of samples between steps as the Transformer.transform method does not return the y argument that would need to also be resampled. This is a know limitation of the current design. It might be fixed in a future version but we have not started to work on that yet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM