Answers for "sklearn labelbinarizer in pipeline"

0

sklearn labelbinarizer in pipeline

from sklearn.preprocessing import LabelBinarizer

class LabelBinarizerPipelineFriendly(LabelBinarizer):
    def fit(self, X, y=None):
        """this would allow us to fit the model based on the X input."""
        super(LabelBinarizerPipelineFriendly,self).fit(X)
    def transform(self, X, y=None):
        return super(LabelBinarizerPipelineFriendly, self).transform(X)
    def fit_transform(self, X, y=None):
        return super(LabelBinarizerPipelineFriendly, self).fit(X).transform(X)
Posted by: Guest on August-15-2020

Code answers related to "sklearn labelbinarizer in pipeline"

Python Answers by Framework

Browse Popular Code Answers by Language