[英]How to add oversampling/undersampling procedure in scikit's Pipeline?
I would like to add oversampling procedure, like SMOTE oversampling , to scikit's Pipeline . 我想将过采样程序(如SMOTE过采样)添加到scikit的Pipeline中 。 But the transformers only supports
fit
and transform
method, and do not provide a way to increase the number of samples and targets. 但是变换器只支持
fit
和transform
方法,并没有提供增加样本和目标数量的方法。
One possible way to do this is to break the pipeline to two separate pipelines connected by SMOTE sampling. 一种可能的方法是将管道分成两个由SMOTE采样连接的独立管道。
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. 我们当前的
Pipeline
不支持更改步骤之间的样本数,因为Transformer.transform
方法不返回需要重新采样的y
参数。 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.
它可能会在未来版本中修复,但我们还没有开始研究它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.