Batch-Running Recommendations¶
The lenskit.batch module contains support for batch-running recommender and predictor
algorithms. This is often used as part of a recommender evaluation experiment.
Rating Prediction¶
-
lenskit.batch.predict(algo, pairs, model=None)¶ Generate predictions for user-item pairs. The provided algorithm should be a
algorithms.Predictoror a function of two arguments: the user ID and a list of item IDs. It should return a dictionary or apandas.Seriesmapping item IDs to predictions.Parameters: - or (predictor(callable) – py:class:algorithms.Predictor): a rating predictor function or algorithm.
- pairs (pandas.DataFrame) – a data frame of (
user,item) pairs to predict for. If this frame also contains aratingcolumn, it will be included in the result. - model (any) – a model for the algorithm.
Returns: a frame with columns
user,item, andpredictioncontaining the prediction results. Ifpairscontains a rating column, this result will also contain a rating column.Return type: