1from sklearn.preprocessing import LabelBinarizer
2
3class LabelBinarizerPipelineFriendly(LabelBinarizer):
4 def fit(self, X, y=None):
5 """this would allow us to fit the model based on the X input."""
6 super(LabelBinarizerPipelineFriendly,self).fit(X)
7 def transform(self, X, y=None):
8 return super(LabelBinarizerPipelineFriendly, self).transform(X)
9 def fit_transform(self, X, y=None):
10 return super(LabelBinarizerPipelineFriendly, self).fit(X).transform(X)