Skip to content

Using Encoder.oneHot like scikit-learn LabelBinarizer #28

Description

@dariyooo

First of all thanks for this nice package! But sadly I am already stuck at the beginning.

I am trying to use the Encoder.oneHot like the LabelBinarizer from scikit-learn. But I am not sure how to achieve that if it is even possible.

What I want is basically this:

# create an oneHotEncoder for my labels
y = ["a", "b", "c", ...]   # the labels i want to one hot encode
lb = LabelBinarizer()
lb.fit(y)
o_y = lb.transform(y)

# inference of CNN
...

# use the encoder on a prediction of a CNN to get the label (string) of the class
prediction = lb.inverse_transform(predicted)

The Encoder.oneHot forces me to provide a dataFrame instance to the constructor. However from the README it is not clear to me how that dataFrame should look like (also could you please update the link to the black friday data set).

Your help would be highly appreciated!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions