fit_transform() takes 2 positional arguments but 3 were given with LabelBinarizer

前端 未结 13 1985
时光取名叫无心
时光取名叫无心 2020-12-07 16:35

I am totally new to Machine Learning and I have been working with unsupervised learning technique.

Image shows my sample Data(After all Cleaning) Screenshot : Sample

13条回答
  •  我在风中等你
    2020-12-07 17:04

    You can create one more Custom Transformer which does the encoding for you.

    class CustomLabelEncode(BaseEstimator, TransformerMixin):
        def fit(self, X, y=None):
            return self
        def transform(self, X):
            return LabelEncoder().fit_transform(X);
    

    In this example, we have done LabelEncoding but you can use LabelBinarizer as well

提交回复
热议问题