Open romanwolf-git opened 1 year ago
Could it be that the method _fit_resample()
in MLSMOTE_resampler
has a preceding underscore? Try removing the _
.
@solegalli I tried it with and without still with the same result. The reason why I tried it with was just to follow the SMOTE class of imbalanced-learn.
Not inheriting from the TransformerMixin
and by implementing fit_resample
, as @solegalli mentioned, will fix your problem.
I am trying to implement a custom transformer for multilabel SMOTE in my pipeline. However, I constantly run into: "All intermediate steps of the chain should be estimators that implement fit and transform or fit_resample (but not both) or be a string 'passthrough' 'MLSMOTE_resampler(n_samples=100)' (type <class 'upsampling_multilabel_data_with_mlsmote.MLSMOTE_resampler'>) doesn't). Here's my code for the class
This is my pipeline: