imblearn's Pipeline.fit_resample() with "passthrough" last step returns only transformed X?

44 Views Asked by At

Is there a particular reason for imblearn.Pipeline's fit_resample to only return Xt and not yt when the last step is "passthrough"? I was expecting it to return both X and y resampled.

(See the source code snippet)

I wonder if this could be a bug, since it breaks the standard Xt, yt return value of fit_resample specified in the user guide (if there is indeed such a standard).

Is there some simple explanation that I am not aware of, such as compatibility with sklearn's API or something like that? I could not find other notes or GH issues regarding this, but it seemed reasonable to post here before opening an issue in case I am missing something.

Edit: I just noticed that the method's docstring (see the linked source code) makes no mention to possibly returning a single object, simply listing Xt and yt as return values, which seems to corroborate this being some sort of bug.

0

There are 0 best solutions below