All Projects → maciejkula → Spotlight

maciejkula / Spotlight

Licence: mit
Deep recommender models using PyTorch.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Spotlight

Lightfm
A Python implementation of LightFM, a hybrid recommendation algorithm.
Stars: ✭ 3,884 (+48.07%)
Mutual labels:  recommender-system, matrix-factorization, learning-to-rank
Orange3 Recommendation
🍊 👎 Add-on for Orange3 to support recommender systems.
Stars: ✭ 21 (-99.2%)
Mutual labels:  recommender-system, matrix-factorization
Fastfm
fastFM: A Library for Factorization Machines
Stars: ✭ 908 (-65.38%)
Mutual labels:  recommender-system, matrix-factorization
Polara
Recommender system and evaluation framework for top-n recommendations tasks that respects polarity of feedbacks. Fast, flexible and easy to use. Written in python, boosted by scientific python stack.
Stars: ✭ 205 (-92.18%)
Mutual labels:  recommender-system, matrix-factorization
Recommender System With Tf2.0
Recurrence the recommender paper with Tensorflow2.0
Stars: ✭ 622 (-76.29%)
Mutual labels:  recommender-system, matrix-factorization
Recsys2019 deeplearning evaluation
This is the repository of our article published in RecSys 2019 "Are We Really Making Much Progress? A Worrying Analysis of Recent Neural Recommendation Approaches" and of several follow-up studies.
Stars: ✭ 780 (-70.26%)
Mutual labels:  recommender-system, matrix-factorization
Elliot
Comprehensive and Rigorous Framework for Reproducible Recommender Systems Evaluation
Stars: ✭ 49 (-98.13%)
Mutual labels:  recommender-system, matrix-factorization
Daisyrec
A developing recommender system in pytorch. Algorithm: KNN, LFM, SLIM, NeuMF, FM, DeepFM, VAE and so on, which aims to fair comparison for recommender system benchmarks
Stars: ✭ 280 (-89.33%)
Mutual labels:  recommender-system, matrix-factorization
Expo Mf
Exposure Matrix Factorization: modeling user exposure in recommendation
Stars: ✭ 81 (-96.91%)
Mutual labels:  recommender-system, matrix-factorization
Flurs
🌊 FluRS: A Python library for streaming recommendation algorithms
Stars: ✭ 97 (-96.3%)
Mutual labels:  recommender-system, matrix-factorization
Implicit
Fast Python Collaborative Filtering for Implicit Feedback Datasets
Stars: ✭ 2,569 (-2.06%)
Mutual labels:  recommender-system, matrix-factorization
Buffalo
TOROS Buffalo: A fast and scalable production-ready open source project for recommender systems
Stars: ✭ 498 (-81.01%)
Mutual labels:  recommender-system, matrix-factorization
Rectorch
rectorch is a pytorch-based framework for state-of-the-art top-N recommendation
Stars: ✭ 121 (-95.39%)
Mutual labels:  recommender-system, matrix-factorization
Cofactor
CoFactor: Regularizing Matrix Factorization with Item Co-occurrence
Stars: ✭ 160 (-93.9%)
Mutual labels:  recommender-system, matrix-factorization
Cornac
A Comparative Framework for Multimodal Recommender Systems
Stars: ✭ 308 (-88.26%)
Mutual labels:  recommender-system, matrix-factorization
Recoder
Large scale training of factorization models for Collaborative Filtering with PyTorch
Stars: ✭ 46 (-98.25%)
Mutual labels:  recommender-system, matrix-factorization
rec-a-sketch
content discovery... IN 3D
Stars: ✭ 45 (-98.28%)
Mutual labels:  matrix-factorization, recommender-system
pprec
a recommender engine node-js package for general use and easy to integrate.
Stars: ✭ 29 (-98.89%)
Mutual labels:  matrix-factorization, recommender-system
Recosystem
Recommender System Using Parallel Matrix Factorization
Stars: ✭ 74 (-97.18%)
Mutual labels:  recommender-system, matrix-factorization
Carskit
Java-Based Context-aware Recommendation Library
Stars: ✭ 98 (-96.26%)
Mutual labels:  recommender-system, matrix-factorization

docs/_static/img/spotlight.png


https://travis-ci.org/maciejkula/spotlight.svg?branch=master https://ci.appveyor.com/api/projects/status/jq5e76a7a08ra2ji/branch/master?svg=true https://badges.gitter.im/gitterHQ/gitter.png https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat

Spotlight uses PyTorch to build both deep and shallow recommender models. By providing both a slew of building blocks for loss functions (various pointwise and pairwise ranking losses), representations (shallow factorization representations, deep sequence models), and utilities for fetching (or generating) recommendation datasets, it aims to be a tool for rapid exploration and prototyping of new recommender models.

See the full documentation for details.

Installation

conda install -c maciejkula -c pytorch spotlight

Usage

Factorization models

To fit an explicit feedback model on the MovieLens dataset:

from spotlight.cross_validation import random_train_test_split
from spotlight.datasets.movielens import get_movielens_dataset
from spotlight.evaluation import rmse_score
from spotlight.factorization.explicit import ExplicitFactorizationModel

dataset = get_movielens_dataset(variant='100K')

train, test = random_train_test_split(dataset)

model = ExplicitFactorizationModel(n_iter=1)
model.fit(train)

rmse = rmse_score(model, test)

To fit an implicit ranking model with a BPR pairwise loss on the MovieLens dataset:

from spotlight.cross_validation import random_train_test_split
from spotlight.datasets.movielens import get_movielens_dataset
from spotlight.evaluation import mrr_score
from spotlight.factorization.implicit import ImplicitFactorizationModel

dataset = get_movielens_dataset(variant='100K')

train, test = random_train_test_split(dataset)

model = ImplicitFactorizationModel(n_iter=3,
                                   loss='bpr')
model.fit(train)

mrr = mrr_score(model, test)

Sequential models

Recommendations can be seen as a sequence prediction task: given the items a user has interacted with in the past, what will be the next item they will interact with? Spotlight provides a range of models and utilities for fitting next item recommendation models, including

from spotlight.cross_validation import user_based_train_test_split
from spotlight.datasets.synthetic import generate_sequential
from spotlight.evaluation import sequence_mrr_score
from spotlight.sequence.implicit import ImplicitSequenceModel

dataset = generate_sequential(num_users=100,
                              num_items=1000,
                              num_interactions=10000,
                              concentration_parameter=0.01,
                              order=3)

train, test = user_based_train_test_split(dataset)

train = train.to_sequence()
test = test.to_sequence()

model = ImplicitSequenceModel(n_iter=3,
                              representation='cnn',
                              loss='bpr')
model.fit(train)

mrr = sequence_mrr_score(model, test)

Datasets

Spotlight offers a slew of popular datasets, including Movielens 100K, 1M, 10M, and 20M. It also incorporates utilities for creating synthetic datasets. For example, generate_sequential generates a Markov-chain-derived interaction dataset, where the next item a user chooses is a function of their previous interactions:

from spotlight.datasets.synthetic import generate_sequential

# Concentration parameter governs how predictable the chain is;
# order determins the order of the Markov chain.
dataset = generate_sequential(num_users=100,
                              num_items=1000,
                              num_interactions=10000,
                              concentration_parameter=0.01,
                              order=3)

Examples

  1. Rating prediction on the Movielens dataset.
  2. Using causal convolutions for sequence recommendations.
  3. Bloom embedding layers.

How to cite

Please cite Spotlight if it helps your research. You can use the following BibTeX entry:

@misc{kula2017spotlight,
  title={Spotlight},
  author={Kula, Maciej},
  year={2017},
  publisher={GitHub},
  howpublished={\url{https://github.com/maciejkula/spotlight}},
}

Contributing

Spotlight is meant to be extensible: pull requests are welcome. Development progress is tracked on Trello: have a look at the outstanding tickets to get an idea of what would be a useful contribution.

We accept implementations of new recommendation models into the Spotlight model zoo: if you've just published a paper describing your new model, or have an implementation of a model from the literature, make a PR!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].