Skip to content

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('', 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',
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