All Projects → bibs2091 → pprec

bibs2091 / pprec

Licence: other
a recommender engine node-js package for general use and easy to integrate.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to pprec

recommender system with Python
recommender system tutorial with Python
Stars: ✭ 106 (+265.52%)
Mutual labels:  matrix-factorization, recommendation-engine, recommender-system
retailbox
🛍️RetailBox - eCommerce Recommender System using Machine Learning
Stars: ✭ 32 (+10.34%)
Mutual labels:  matrix-factorization, recommendation-engine, recommender-system
Cornac
A Comparative Framework for Multimodal Recommender Systems
Stars: ✭ 308 (+962.07%)
Mutual labels:  matrix-factorization, recommendation-engine, recommender-system
Carskit
Java-Based Context-aware Recommendation Library
Stars: ✭ 98 (+237.93%)
Mutual labels:  matrix-factorization, recommendation-engine, recommender-system
Rectorch
rectorch is a pytorch-based framework for state-of-the-art top-N recommendation
Stars: ✭ 121 (+317.24%)
Mutual labels:  matrix-factorization, recommender-system
Flurs
🌊 FluRS: A Python library for streaming recommendation algorithms
Stars: ✭ 97 (+234.48%)
Mutual labels:  matrix-factorization, recommender-system
Cofactor
CoFactor: Regularizing Matrix Factorization with Item Co-occurrence
Stars: ✭ 160 (+451.72%)
Mutual labels:  matrix-factorization, recommender-system
Implicit
Fast Python Collaborative Filtering for Implicit Feedback Datasets
Stars: ✭ 2,569 (+8758.62%)
Mutual labels:  matrix-factorization, recommender-system
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 (+606.9%)
Mutual labels:  matrix-factorization, recommender-system
Spotlight
Deep recommender models using PyTorch.
Stars: ✭ 2,623 (+8944.83%)
Mutual labels:  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 (-37.93%)
Mutual labels:  matrix-factorization, recommender-system
Course-Recommendation-System
A system that will help in a personalized recommendation of courses for an upcoming semester based on the performance of previous semesters.
Stars: ✭ 14 (-51.72%)
Mutual labels:  matrix-factorization, recommender-system
Expo Mf
Exposure Matrix Factorization: modeling user exposure in recommendation
Stars: ✭ 81 (+179.31%)
Mutual labels:  matrix-factorization, recommender-system
Rsparse
Fast and accurate machine learning on sparse matrices - matrix factorizations, regression, classification, top-N recommendations.
Stars: ✭ 145 (+400%)
Mutual labels:  matrix-factorization, recommender-system
Recosystem
Recommender System Using Parallel Matrix Factorization
Stars: ✭ 74 (+155.17%)
Mutual labels:  matrix-factorization, recommender-system
Elliot
Comprehensive and Rigorous Framework for Reproducible Recommender Systems Evaluation
Stars: ✭ 49 (+68.97%)
Mutual labels:  matrix-factorization, recommender-system
Awesome-Machine-Learning-Papers
📖Notes and remarks on Machine Learning related papers
Stars: ✭ 35 (+20.69%)
Mutual labels:  matrix-factorization, recommender-system
Orange3 Recommendation
🍊 👎 Add-on for Orange3 to support recommender systems.
Stars: ✭ 21 (-27.59%)
Mutual labels:  matrix-factorization, recommender-system
Recoder
Large scale training of factorization models for Collaborative Filtering with PyTorch
Stars: ✭ 46 (+58.62%)
Mutual labels:  matrix-factorization, recommender-system
Recommendation.jl
Building recommender systems in Julia
Stars: ✭ 42 (+44.83%)
Mutual labels:  matrix-factorization, recommender-system

credit: Lina Khiati

pprec

PPREC is a node-js library made for web applications to help them integrate a recommendation systems easily. The library offers a higher level of abstraction for developers who are not comfortable with concepts like tensors, layers, optimizers and loss functions, and want to add a recommender in few lines of code.

To run the project you need to have redis installed then start it:

redis-server

and install the package in your project:

npm install pprec

Getting started

Here is a basic usage for pprec, just follow the steps:

  1. Import pprec
import { dataBlock, learner } from 'pprec';
  1. Do you have exiting dataset of past ratings of your service users?
const myLearner = learner();
  1. If your website have new users or items you can tell pprec about them like this.
  2. if a user rated an item, you should also tell pprec so it can adjust its recommendations on it like this.
  3. Generate k recommendations for a user:
// recommend 7 items for the user with the ID = "MohamedNaas001"
myLearner.recommendItems("MohamedNaas001", 7)

Usage

Load data

You can either load data in pprec from a csv file or existing tensors:

  • CSV file: Specify the columns names that contains the information about the users, items, and ratings.
const data = await dataBlock().fromCsv("data.csv", {
        userColumn: 'user',
        itemColumn: 'movie', 
        ratingColumn: 'rating',
        ratingRange: [0, 5]
        });
  • Javascript array:
const data = dataBlock().fromArray(
    items = [10,7,3,10],
    users = [15,30,1,500],
    ratings = [1,2,2,5]
    );

if you don't have any data yet to use for training jump to Without DataBlock.

Creating a Learner

Learner is the responsible for training the recommendation model and infrencing/generating recommendations from it. To create a learner:

const myLearner = learner(datass);

Optimize the Learner

fit (train) the learner for few epoches:

await myLearner.fit(3);

Adding a rating

pprec supports online learning so it will allow adding a new rating to the dataset and adjust the learner to it:

await myLearner.addRating("MohamedNaas001", "The office", 5);

You do not need to run myLearner.fit() again, as it is already embedded in the addRating() method.

Adding new user/item

In case there is a new user or item in your system, you should explicitly inform pprec before trying to add recommendations and generating recommendations to them:

myLearner.newUser("UUID25435") //add a new user with the id UUID25435

myLearner.newItem("Squid Games") //add a new user with the id UUID25435

The new user/item latent factors (embeddings) will be the average of the existing latent factors for all the existing users/items.

Generating recommendation

To generate k items recommendations for a user just do this

console.log(myLearner.recommendItems("MohamedNaas001", 7, false)); 
//recommend 7 items for the user with ID = "MohamedNaas001" 

By default, the recommendation will not be repeated, this means if a user already viewed or rated an item it will be saved in redis to be eliminated in the recommendation process. Switch alreadyWatched to true to remove this feature.

To tell pprec that a user viewed an item:

myLearner.viewed("MohamedNaas001", "Dark")

viewing an item means that the user viewed the item but it did not rate it.

Similar items/users

You can get the k similar items to an item or users to a user using the cosine similarity between the items/users latent factors:

console.log(myLearner.mostSimilarUsers(""MohamedNaas001""));

console.log(myLearner.mostSimilarItems("House MD"));

Saving and Loading Learner

To save a the trained learner

myLearner.save("myModel"); 

To load a learner

await myLearner.load("myModel"); 

Saving an existing DataBlock

To save a datablock in csv format:

await data.save("IMDB.csv")

You can use the DataBlock.fromCsv() method to load the data in pprec again.

Without DataBlock

pprec takes into account the case when a website does not have any data to build the recommendation on, in this case you can initilize the Learner directly then add users, items, and ratings to it. Example

const myLearner = learner();

myLearner.newUser("UUID25435");

myLearner.newItem("Squid Games");

await myLearner.addRating("UUID25435", "Squid Games", 4);

The current progress:

  • Learner
  • DataBlock
  • Local DP
  • Documentation: https://pprec.netlify.app/
  • Contribution guide
  • Output DP
  • Gradient perturbation
  • Other algorthims than Matrix factorization

Support the project

I would really appreciate if you donate to me so i can continue working on the project: Here  

Wanna contribute? check the contribution guide

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].