Closed fingoldo closed 1 year ago
Hi, is there any particular reason for imblearn pipeline to return None when last step has no fit_resample method?
This is how fit_resample method currently ends:
if hasattr(last_step, "fit_resample"): return last_step.fit_resample(Xt, yt, **fit_params_last_step)
But I am trying to use imblearn.Pipeline in a general setup where resampling is optional.
if hasattr(last_step, "fit_resample"): return last_step.fit_resample(Xt, yt, **fit_params_last_step) else: last_step.fit(Xt, yt, **fit_params_last_step) return Xt, yt
Subclassing of imblearn.Pipeline. But i'm sure many folks out there will benefit from implementing this change.
In this case you should only call fit because you only want to fit the last step (and apply previous resampling if any).
fit
Hi, is there any particular reason for imblearn pipeline to return None when last step has no fit_resample method?
This is how fit_resample method currently ends:
But I am trying to use imblearn.Pipeline in a general setup where resampling is optional.
Describe the solution you'd like
Describe alternatives you've considered
Subclassing of imblearn.Pipeline. But i'm sure many folks out there will benefit from implementing this change.