Skip to content

Instantly share code, notes, and snippets.

Created August 10, 2016 18:32
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 anonymous/1f056fe48d79377f5922e8e6a5294e80 to your computer and use it in GitHub Desktop.
Save anonymous/1f056fe48d79377f5922e8e6a5294e80 to your computer and use it in GitHub Desktop.
Brief tutorial Iris classification with GraphLab
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