In this recipe, we'll be building a recommendation system. A recommender is an information-filtering system that predicts rankings or similarities by bringing content and social connections together.
We'll download a dataset of book ratings that have been collected from the Goodreads website, where users rank and review books that they've read. We'll build different recommender models, and we'll suggest new books based on known ratings.
Getting ready
To prepare for our recipe, we'll download the dataset and install the required dependencies.
Let's get the dataset and install the two libraries we'll use here – spotlight and lightfm are recommender libraries:
!pip install git+https://github.com/maciejkula/spotlight.git lightfm
Then we need to get the dataset of book ratings:
from spotlight.datasets.goodbooks import get_goodbooks_dataset
from spotlight.cross_validation import random_train_test_split
import numpy as np
interactions...