Created
July 17, 2017 20:06
-
-
Save gavi/014d8378c44502b5c66fb7cb6b27fa89 to your computer and use it in GitHub Desktop.
Basic scikit learn with IRIS data
This file contains hidden or 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 datasets | |
from sklearn.ensemble import RandomForestClassifier | |
import coremltools | |
iris = datasets.load_iris() | |
clf = RandomForestClassifier() | |
clf.fit(iris.data, iris.target_names[iris.target]) | |
#Test to see if it is working correctly | |
print(list(clf.predict(iris.data[:3]))) | |
print(list(clf.predict([[ 5.1,3.5,1.4,0.2]]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment