Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wetlife/a4ffd004ee77daf2e2b19e310c5dfa3e to your computer and use it in GitHub Desktop.
Save wetlife/a4ffd004ee77daf2e2b19e310c5dfa3e to your computer and use it in GitHub Desktop.
MWE: ingest data via sklearn
>>> 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