PySuggestify
is a module for building personalized recommendation system with PMF algorithm.
Table of Contents:
Welcome to PySuggestify
– an recommendation system implemented with Probabilistic Matrix Factorization (PMF) algorithm. This project aims to provide a low-code solution for building personalized recommender models.
For instance you can build a solution for suggesting movies on a streaming platform based on user ratings.
My implementation incorporates Probabilistic Matrix Factorization (PMF), an advanced and powerful technique for collaborative filtering.
By leveraging PMF, the recommender system captures latent factors within the item-user interaction matrix, enabling it to generate precise and personalized item recommendations. This algorithm takes into account complex patterns and dependencies, ensuring high-quality suggestions that align with the unique preferences and tastes of each customer.
PySuggestify has been equipped with a user-friendly interface, similar to the most popular ones like sklearn/keras. The low-code approach eliminates the need for complex implementation details, allowing users to focus on optimizing the recommendation system to suit their specific needs.
The pysuggestify recommender system operates through a multi-step process to provide accurate predictions for user-item ratings. Here's an overview of how it works:
- Data Preparation: Initially, pysuggestify takes in user-item interactions data, typically in the form of a user-item matrix with rating values. The majority of cells in this matrix are empty, representing unrated items by users.
- Probabilistic Matrix Factorization: pysuggestify leverages the power of the Probabilistic Matrix Factorization (PMF) algorithm to learn the underlying dependencies between users and items. By decomposing the user-item matrix into latent factors, PMF identifies hidden patterns and captures the essence of user preferences.
- Model Training: Using the PMF algorithm, the recommender system trains the model based on the available user-item ratings. It iteratively optimizes the model parameters to minimize the error between predicted and actual ratings.
- Prediction Generation: Once the model is trained, it can accurately predict the ratings for items that have not yet been rated by a given user. By utilizing the learned dependencies and latent factors, pysuggestify provides personalized rating predictions tailored to individual user preferences.
By following this approach, pysuggestify unlocks the power of PMF algorithm, enabling accurate predictions for missing ratings in the user-item matrix. This allows businesses to offer personalized recommendations and enhance user experiences in various domains, such as movies, products, or content.
Use pip to install from pypi:
pip install pysuggestify
or directly from github
pip install -e git+https://github.com/msoczi/pysuggestify#egg=pysuggestify
from pysuggestify.PMF import PMF
# Load example dataset
ratings = pd.read_csv('data/ratings.csv')
# Defince instance of PMF class
PMF_model = PMF(n_dims = 30)
# Prepare data for modeling.
# Specify dataframe and names of ID columns for users, items, ratings.
PMF_model.prepare_data(ratings, 'userId', 'movieId', 'rating')
# Fit model
PMF_model.fit(n_epochs=10)
# Get predictions
PMF_model.predict()
# Get predictions for specific user and item
PMF_model.predict_one(user_id=1, item_id=2)
Here is a notebook with example.
Mateusz Soczewka - msoczewkas@gmail.com
Thank you for any comments. 😃