Skip to content

Instantly share code, notes, and snippets.

@up1
Created September 29, 2014 16:36
Show Gist options
  • Save up1/c7cf472390b0f7c73e20 to your computer and use it in GitHub Desktop.
Save up1/c7cf472390b0f7c73e20 to your computer and use it in GitHub Desktop.
GraphLab :: demo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import graphlab
graphlab.canvas.set_target('ipynb')
data = graphlab.SFrame.read_csv("http://s3.amazonaws.com/GraphLab-Datasets/movie_ratings/training_data.csv", column_type_hints={"rating":int})
data.head()
model = graphlab.recommender.create(data, user_id="user", item_id="movie", target="rating")
results = model.recommend(users=None, k=5)
results.head()
model.save("my_model")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment