Skip to content

Instantly share code, notes, and snippets.

@krunal3kapadiya
Created December 17, 2016 18:56
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 krunal3kapadiya/d084717f31eb200b8b50e4f4e21ac66d to your computer and use it in GitHub Desktop.
Save krunal3kapadiya/d084717f31eb200b8b50e4f4e21ac66d to your computer and use it in GitHub Desktop.
Gist contains decision tree classifiers example.
from sklearn import tree
features=[[140,1],[130,1],[150,0],[170,0]]
labels=[0,0,1,1]
clf=tree.DecisionTreeClassifier()
clf=clf.fit(features,labels)
print clf.predict([[150,0]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment