You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get this error when I try to use LabelBinarizer and LabelEncoder in a Pipeline:
sklearn/pipeline.pycinfit_transform(self, X, y, **fit_params)
141Xt, fit_params=self._pre_transform(X, y, **fit_params)
142ifhasattr(self.steps[-1][-1], 'fit_transform'):
-->143returnself.steps[-1][-1].fit_transform(Xt, y, **fit_params)
144else:
145returnself.steps[-1][-1].fit(Xt, y, **fit_params).transform(Xt)
TypeError: fit_transform() takesexactly2arguments (3given)
It seems like this is because the classes' fit and transform signatures are different from most other estimators and only accept a single argument.
I think this is a pretty easy fix (just change the signature to def(self, X, y=None)) that I'd be happy to send a pull request for, but I wanted to check if there were any other reasons that the signatures are the way they are that I didn't think of.