Skip to content

Instantly share code, notes, and snippets.

@valduze
Forked from alejandrofloresm/hello-world.py
Created April 16, 2016 20:23
Show Gist options
  • Save valduze/3e2e83931b9a1e9474c0baf4828539c4 to your computer and use it in GitHub Desktop.
Save valduze/3e2e83931b9a1e9474c0baf4828539c4 to your computer and use it in GitHub Desktop.
Hello World for Google
# Code example for:
# Hello World - Machine Learning Recipes #1 - Google Developers
# https://www.youtube.com/watch?v=cKxRvEZd3Mw
from sklearn import tree
# Bumpy = 0, Smooth = 1
features = [[140, 1], [130, 1], [150, 0], [170, 0]]
# Apple = 0, Orange = 1
labels = [0, 0, 1, 1]
clf = tree.DecisionTreeClassifier()
clf = clf.fit(features, labels)
print clf.predict([[160, 0]])
@valduze
Copy link
Author

valduze commented Apr 16, 2016

I would like to write more about this

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