Forked from anonymous/gist:b6e4c0c2aa3b90f82c49af9e640a050a
Last active
October 21, 2018 16:44
-
-
Save wetlife/a4ffd004ee77daf2e2b19e310c5dfa3e to your computer and use it in GitHub Desktop.
MWE: ingest data via sklearn
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