Algorithm Summary

LKPY provides general algorithmic concepts, along with implementations of several algorithms. These algorithm interfaces are based on the SciKit design patterns [SKAPI], adapted for Pandas-based data structures.

All algorithms implement the standard interfaces.

Basic Algorithms

bias.Bias([items, users, damping])

A user-item bias rating prediction algorithm.


Recommend the most popular items.

basic.TopN(predictor[, selector])

Basic recommender that implements top-N recommendation using a predictor.

basic.Fallback(algorithms, *others)

The Fallback algorithm predicts with its first component, uses the second to fill in missing values, and so forth.


CandidateSelector that selects items a user has not rated as candidates.


The memorized algorithm memorizes socres provided at construction time.

k-NN Algorithms

user_knn.UserUser(nnbrs[, min_nbrs, …])

User-user nearest-neighbor collaborative filtering with ratings.

item_knn.ItemItem(nnbrs[, min_nbrs, …])

Item-item nearest-neighbor collaborative filtering with ratings.

Matrix Factorization

als.BiasedMF(features, *[, iterations, reg, …])

Biased matrix factorization trained with alternating least squares [ZWSP2008].

als.ImplicitMF(features, *[, iterations, …])

Implicit matrix factorization trained with alternating least squares [HKV2008].

funksvd.FunkSVD(features[, iterations, …])

Algorithm class implementing FunkSVD matrix factorization.


tf.BiasedMF([features, bias, damping, …])

Biased matrix factorization model for explicit feedback, optimized with TensorFlow.

tf.IntegratedBiasMF([features, epochs, …])

Biased matrix factorization model for explicit feedback, optimizing both bias and embeddings with TensorFlow.

tf.BPR([features, epochs, batch_size, reg, …])

Bayesian Personalized Ranking with matrix factorization, optimized with TensorFlow.

External Library Wrappers

implicit.BPR(*args, **kwargs)

LensKit interface to implicit.bpr.

implicit.ALS(*args, **kwargs)

LensKit interface to implicit.als.

hpf.HPF(features, **kwargs)

Hierarchical Poisson factorization, provided by hpfrec.



Lars Buitinck, Gilles Louppe, Mathieu Blondel, Fabian Pedregosa, Andreas Mueller, Olivier Grisel, Vlad Niculae, Peter Prettenhofer, Alexandre Gramfort, Jaques Grobler, Robert Layton, Jake Vanderplas, Arnaud Joly, Brian Holt, and Gaël Varoquaux. 2013. API design for machine learning software: experiences from the scikit-learn project. arXiv:1309.0238 [cs.LG].