profile shabazp/recommendation system

Updated Tue, October 17th - 06:30 AM GMT

Clone Model
copy Copy to clipboard

Install the Datmo CLI and clone this model.


$ datmo clone shabazp/recommendation-system

README.md

recommendation system

Datmo Model

Recommendation system using lightfm

In this example, we’ll build an implicit feedback recommender using the Movielens 100k dataset (http://grouplens.org/datasets/movielens/100k/).

The code behind this example is available as a Jupyter notebook

LightFM includes functions for getting and processing this dataset, so obtaining it is quite easy.

This downloads the dataset and automatically pre-processes it into sparse matrices suitable for further calculation. In particular, it prepares the sparse user-item matrices, containing positive entries where a user interacted with a product, and zeros otherwise.

We’re going to use the WARP (Weighted Approximate-Rank Pairwise) model. WARP is an implicit feedback model: all interactions in the training matrix are treated as positive signals, and products that users did not interact with they implicitly do not like. The goal of the model is to score these implicit positives highly while assigining low scores to implicit negatives.

Done! We should now evaluate the model to see how well it’s doing. We’re most interested in how good the ranking produced by the model is. Precision@k is one suitable metric, expressing the percentage of top k (in our case we use 5) items in the ranking the user has actually interacted with. lightfm implements a number of metrics in the evaluation module.

Clone this model on your local machine with the Datmo CLI

 $ datmo clone shabazp/recommendation-system

Now you can run the set of commands below to better understand the advantages of converting a repository to a Datmo Model.

First you can check out all of the snapshots that have already been created by the user. This is equivalent to checking out the snapshots tab on Datmo except without the search and filter capabilities available on the GUI.

 $ datmo snapshot ls 

Once you have viewed all of the existing snapshots, you can start by running an experiment by simply running the notebook below which will run the Jupyter notebook and enable you to run piece of code to train the model.

 $ datmo task run "jupyter notebook" --port 888

After you're done, open another terminal or use the same one to create your first snapshot, by running the following command

 $ datmo snapshot create -m "my first snapshot"

Congrats! You have created your first snapshot and are ready to continue building on top of it. Check out more commands on our docs here.

Happy Building :)

Related Models
navneet
No snapshots
anands
No snapshots
akshayjain
No snapshots
Sessions

default

Snaphots: 1 4 months ago

Source Git Repository

python 0 Bytes

Updated: Invalid date GMT