Created
August 10, 2016 18:32
-
-
Save anonymous/1f056fe48d79377f5922e8e6a5294e80 to your computer and use it in GitHub Desktop.
Brief tutorial Iris classification with GraphLab
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
import graphlab as gl | |
iris = gl.SFrame.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data', header=False) | |
iris.rename({'X1': 'SepalLength', 'X2': 'SepalWidth', 'X3': 'PetalLength', 'X4': 'PetalWidth', 'X5': 'Species'}) | |
train_data, test_data = iris.random_split(0.8) | |
model = gl.classifier.create(train_data, target='Species', | |
features = ['SepalLength', | |
'SepalWidth', | |
'PetalLength', | |
'PetalWidth']) | |
predictions = model.classify(test_data) | |
results = model.evaluate(test_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment