Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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