All Projects → rexyai → Rsparse

rexyai / Rsparse

Licence: other
Fast and accurate machine learning on sparse matrices - matrix factorizations, regression, classification, top-N recommendations.

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Rsparse

Recommendation.jl
Building recommender systems in Julia
Stars: ✭ 42 (-71.03%)
Mutual labels:  collaborative-filtering, matrix-factorization, recommender-system, factorization-machines
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 (+93.1%)
Mutual labels:  recommender-system, collaborative-filtering, matrix-factorization, factorization-machines
recommender system with Python
recommender system tutorial with Python
Stars: ✭ 106 (-26.9%)
Mutual labels:  collaborative-filtering, matrix-factorization, recommender-system
Tf-Rec
Tf-Rec is a python💻 package for building⚒ Recommender Systems. It is built on top of Keras and Tensorflow 2 to utilize GPU Acceleration during training.
Stars: ✭ 18 (-87.59%)
Mutual labels:  matrix-factorization, recommender-system, svd
Rankfm
Factorization Machines for Recommendation and Ranking Problems with Implicit Feedback Data
Stars: ✭ 71 (-51.03%)
Mutual labels:  recommender-system, collaborative-filtering, factorization-machines
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 (+41.38%)
Mutual labels:  recommender-system, collaborative-filtering, matrix-factorization
tf-recsys
tf-recsys contains collaborative filtering (CF) model based on famous SVD and SVD++ algorithm. Both of them are implemented by tensorflow in order to utilize GPU acceleration.
Stars: ✭ 91 (-37.24%)
Mutual labels:  collaborative-filtering, recommender-system, svd
Elliot
Comprehensive and Rigorous Framework for Reproducible Recommender Systems Evaluation
Stars: ✭ 49 (-66.21%)
Mutual labels:  recommender-system, collaborative-filtering, matrix-factorization
Cornac
A Comparative Framework for Multimodal Recommender Systems
Stars: ✭ 308 (+112.41%)
Mutual labels:  recommender-system, collaborative-filtering, 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 (+437.93%)
Mutual labels:  recommender-system, collaborative-filtering, matrix-factorization
Flurs
🌊 FluRS: A Python library for streaming recommendation algorithms
Stars: ✭ 97 (-33.1%)
Mutual labels:  recommender-system, matrix-factorization, factorization-machines
Implicit
Fast Python Collaborative Filtering for Implicit Feedback Datasets
Stars: ✭ 2,569 (+1671.72%)
Mutual labels:  recommender-system, collaborative-filtering, matrix-factorization
Awesome-Machine-Learning-Papers
📖Notes and remarks on Machine Learning related papers
Stars: ✭ 35 (-75.86%)
Mutual labels:  collaborative-filtering, matrix-factorization, recommender-system
Rectorch
rectorch is a pytorch-based framework for state-of-the-art top-N recommendation
Stars: ✭ 121 (-16.55%)
Mutual labels:  recommender-system, collaborative-filtering, matrix-factorization
Fastfm
fastFM: A Library for Factorization Machines
Stars: ✭ 908 (+526.21%)
Mutual labels:  recommender-system, matrix-factorization, factorization-machines
Recoder
Large scale training of factorization models for Collaborative Filtering with PyTorch
Stars: ✭ 46 (-68.28%)
Mutual labels:  recommender-system, collaborative-filtering, matrix-factorization
Movielens Recommender
A pure Python implement of Collaborative Filtering based on MovieLens' dataset.
Stars: ✭ 131 (-9.66%)
Mutual labels:  recommender-system, collaborative-filtering
Consimilo
A Clojure library for querying large data-sets on similarity
Stars: ✭ 54 (-62.76%)
Mutual labels:  recommender-system, collaborative-filtering
Fmg
KDD17_FMG
Stars: ✭ 116 (-20%)
Mutual labels:  recommender-system, factorization-machines
Gorse
An open source recommender system service written in Go
Stars: ✭ 1,148 (+691.72%)
Mutual labels:  recommender-system, collaborative-filtering

rsparse

R build status codecov License Project Status

rsparse is an R package for statistical learning primarily on sparse matrices - matrix factorizations, factorization machines, out-of-core regression. Many of the implemented algorithms are particularly useful for recommender systems and NLP.

On top of that we provide some optimized routines to work on sparse matrices - multithreaded <dense, sparse> matrix multiplications and improved support for sparse matrices in CSR format (Matrix::RsparseMatrix), as well as convenience functions to convert between matrix types.

We've paid some attention to the implementation details - we try to avoid data copies, utilize multiple threads via OpenMP and use SIMD where appropriate. Package allows to work on datasets with millions of rows and millions of columns.

Support

Please reach us if you need commercial support - [email protected].

Features

Classification/Regression

  1. Follow the proximally-regularized leader which allows to solve very large linear/logistic regression problems with elastic-net penalty. Solver uses stochastic gradient descent with adaptive learning rates (so can be used for online learning - not necessary to load all data to RAM). See Ad Click Prediction: a View from the Trenches for more examples.
    • Only logistic regerssion implemented at the moment
    • Native format for matrices is CSR - Matrix::RsparseMatrix. However common R Matrix::CsparseMatrix (dgCMatrix) will be converted automatically.
  2. Factorization Machines supervised learning algorithm which learns second order polynomial interactions in a factorized way. We provide highly optimized SIMD accelerated implementation.

Matrix Factorizations

  1. Vanilla Maximum Margin Matrix Factorization - classic approch for "rating" prediction. See WRMF class and constructor option feedback = "explicit". Original paper which indroduced MMMF could be found here.
  2. Weighted Regularized Matrix Factorization (WRMF) from Collaborative Filtering for Implicit Feedback Datasets. See WRMF class and constructor option feedback = "implicit". We provide 2 solvers:
    1. Exact based on Cholesky Factorization
    2. Approximated based on fixed number of steps of Conjugate Gradient. See details in Applications of the Conjugate Gradient Method for Implicit Feedback Collaborative Filtering and Faster Implicit Matrix Factorization.
  3. Linear-Flow from Practical Linear Models for Large-Scale One-Class Collaborative Filtering. Algorithm looks for factorized low-rank item-item similarity matrix (in some sense it is similar to SLIM)
  4. Fast Truncated SVD and Truncated Soft-SVD via Alternating Least Squares as described in Matrix Completion and Low-Rank SVD via Fast Alternating Least Squares. Works for both sparse and dense matrices. Works on float matrices as well! For certain problems may be even faster than irlba package.
  5. Soft-Impute via fast Alternating Least Squares as described in Matrix Completion and Low-Rank SVD via Fast Alternating Least Squares.
    • with a solution in SVD form
  6. GloVe as described in GloVe: Global Vectors for Word Representation.
    • This is usually used to train word embeddings, but actually also very useful for recommender systems.
  7. Matrix scaling as descibed in EigenRec: Generalizing PureSVD for Effective and Efficient Top-N Recommendations

Optimized matrix operations

  1. multithreaded %*% and tcrossprod() for <dgRMatrix, matrix>
  2. multithreaded %*% and crossprod() for <matrix, dgCMatrix>
  3. natively slice CSR matrices (Matrix::RsparseMatrix) without converting them to triplet / CSC

Installation

Most of the algorithms benefit from OpenMP and many of them could utilize high-performance implementation of BLAS. If you want make maximum out of the package please read the section below carefuly.

It is recommended to:

  1. Use high-performance BLAS (such as OpenBLAS, MKL, Apple Accelerate).
  2. Add proper compiler optimizations in your ~/.R/Makevars. For example on recent processors (with AVX support) and complier with OpenMP support following lines could be a good option:
    CXX11FLAGS += -O3 -march=native -mavx -fopenmp -ffast-math
    CXXFLAGS   += -O3 -march=native -mavx -fopenmp -ffast-math
    

If you are on Mac follow instructions here. After installation of clang4 additionally put PKG_CXXFLAGS += -DARMA_USE_OPENMP line to your ~/.R/Makevars. After that install rsparse in a usual way.

Materials

Note that syntax is these posts/slides is not up to date since package was under active development

  1. Slides from DataFest Tbilisi(2017-11-16)
  2. Introduction to matrix factorization with Weighted-ALS algorithm - collaborative filtering for implicit feedback datasets.
  3. Music recommendations using LastFM-360K dataset
    • evaluation metrics for ranking
    • setting up proper cross-validation
    • possible issues with nested parallelism and thread contention
    • making recommendations for new users
    • complimentary item-to-item recommendations
  4. Benchmark against other good implementations

Here is example of rsparse::WRMF on lastfm360k dataset in comparison with other good implementations:

API

We follow mlapi conventions.

Release and configure

Making release

Don't forget to add DARMA_NO_DEBUG to PKG_CXXFLAGS to skip bound checks (this has significant impact on NNLS solver)

PKG_CXXFLAGS = ... -DARMA_NO_DEBUG

Configure

Generate configure:

autoconf configure.ac > configure && chmod +x configure
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].