Created
July 4, 2017 00:20
-
-
Save anonymous/b6e4c0c2aa3b90f82c49af9e640a050a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from sklearn import preprocessing | |
>>> lb = preprocessing.LabelBinarizer() | |
>>> lb.fit_transform(['cat', 'dog', 'bird', 'cat']) | |
array([[0, 1, 0], | |
[0, 0, 1], | |
[1, 0, 0], | |
[0, 1, 0]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment