Skip to content

raliev/recommender-algorithms

Repository files navigation

Recommender System Laboratory

Interactive companion application for Recommender Algorithms in 2026: A Practitioner's Guide

A comprehensive Streamlit application for experimenting with state-of-the-art recommendation algorithms. This interactive laboratory provides real-time training, visualization, and analysis of various recommender system algorithms, making it an ideal companion to the book.

Important: This application is designed primarily for use with small datasets. While it can also handle larger ones, some visualizations may become less informative in that case. Certain algorithms may show weaker performance on very small datasets. Therefore, this tool is not intended to serve as a comprehensive benchmark for algorithms on full-scale datasets — that was never its purpose. Its main goal is academic and educational exploration.

Key Features

  • Interactive Laboratory: Train, configure, and analyze over 25 recommendation algorithms in real-time.
  • Detailed Visualizations: Observe algorithm internals, including convergence plots (loss, RMSE), latent factor evolution (heatmaps, histograms), and model-specific analyses like recommendation breakdowns or learned similarity matrices.
  • Hyperparameter Tuning: Conduct automated parameter searches using Bayesian optimization (Optuna).
  • Dataset Generation Wizard: Design and generate synthetic datasets based on ground-truth user preferences (P) and item features (Q), allowing control over noise, sparsity, and preference distributions.
  • Performance Evaluation: Track standard evaluation metrics for both explicit (RMSE, MAE) and implicit (Precision@k, Recall@k, nDCG, MRR) tasks.
  • Experiment Management: Load and review detailed results from previous hyperparameter tuning runs (Report Viewer) and browse visualizations from individual experiments (Lab Runs).

Getting Started

Prerequisites

  • Python 3.8 or higher

Installation

  1. Clone the repository:

    git clone https://github.com/raliev/recommender-algorithms.git
    cd recommender-algorithms
  2. Install dependencies:

    pip install -r requirements.txt

    Or using a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
  3. Run the application:

    streamlit run app.py

    The application will automatically open in your default browser at http://localhost:8501.

How to Use

This application is divided into several key modules, accessible from the sidebar:

  1. Lab Page: Interactively experiment with a single algorithm. Adjust hyperparameters, enable visualizations, and train models in real-time.
  2. Hyperparameter Tuning Page: Configure and run automated Bayesian optimization (Optuna) for one or more algorithms to find the best-performing configurations.
  3. Dataset Wizard Page: Design and generate synthetic datasets. Define user-preference (P) and item-feature (Q) matrices, apply noise and sparsity, and save the resulting dataset for use in the Lab and Tuner.
  4. Report Viewer Page: Load and analyze the results from previous Hyperparameter Tuning runs.
  5. All Recent Lab Runs Page: Browse the history and view visualizations from individual experiments conducted on the Lab page.

Supported Algorithms

  • ALS - Alternating Least Squares
  • ALS (Improved) - ALS with bias regularization
  • ALS (PySpark) - PySpark implementation
  • ASVD - Asymmetric SVD (no explicit user factors)
  • PureSVD - SVD decomposition for implicit feedback
  • FunkSVD - Stochastic Gradient Descent MF
  • SVD++ - Factorization with implicit feedback
  • NMF - Non-negative Matrix Factorization
  • WRMF - Weighted Regularized Matrix Factorization
  • FISM - Factorized Item Similarity Models
  • EASE - Embarrassingly Shallow Autoencoders
  • ItemKNN - Item-based Collaborative Filtering
  • UserKNN - User-based Collaborative Filtering
  • Slope One - Fast, simple collaborative filtering
  • BPR - Bayesian Personalized Ranking
  • BPR (Adaptive) - BPR with adaptive negative sampling
  • BPR+SVDPP - BPR combined with SVD++ implicit factors
  • WMFBPR - Weighted MF with BPR (uses PageRank)
  • CML - Collaborative Metric Learning
  • SLIM - Sparse Linear Methods
  • NCF/NeuMF - Neural Collaborative Filtering
  • DeepFM - Deep Factorization Machines
  • SimpleX - Simple bi-encoder with contrastive loss
  • SASRec - Self-Attentive Sequential Recommendation
  • VAE - Variational Autoencoders for Collaborative Filtering
  • Apriori - Classic association rule mining
  • FP-Growth - Efficient tree-based rule mining
  • Eclat - Vertical layout-based rule mining
  • Top Popular - Non-personalized popularity baseline

Visualizations

The application provides rich visualizations for understanding algorithm behavior:

  • Convergence Plots: Track objective functions (e.g., RMSE, Loss) and factor change norms over iterations.
  • Latent Factor Snapshots: Visualize user (P) and item (Q) factor matrices via heatmaps, histograms, and 2D projections (for k=2).
  • Similarity/Sparsity Matrices: Analyze learned item-item (SLIM, ItemKNN, EASE) or user-user (UserKNN) relationships.
  • Recommendation Breakdowns: Deconstruct the score generation process for a single sample user.
  • Association Rules: Review frequent itemsets and generated rules (support, confidence, lift) for Apriori/FP-Growth.

About the Book

This application is a companion to Recommender Algorithms in 2026: A Practitioner's Guide by Rauf Aliev. The book provides:

  • Mathematical foundations of each algorithm
  • Implementation details and optimization techniques
  • Production-ready architectures
  • Deep dive into LLM-based and multimodal approaches
  • Real-world applications and best practices

Purchase Options

Available on:

Read sample: https://testmysearch.com/pdfs/books/recommenders-sample.pdf

Configuration

  • Algorithm Parameters: Configure in algorithm_config.py
  • Tuner Settings: Adjust in tuner_config.py
  • Visualization Settings: Modify in visualization/ components

Contributing

We welcome contributions. See our Contributing Guide for details.

Contributions can include:

  • Reporting bugs
  • Suggesting features
  • Submitting pull requests
  • Improving documentation
  • Adding new algorithms
  • Enhancing visualizations

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built as a companion to the "Recommender Algorithms in 2026" book
  • Uses Streamlit for the interactive interface
  • Employs Optuna for hyperparameter optimization
  • Visualizations powered by Plotly and Matplotlib

Contact

For questions or support related to the book or this application:

Screenshots

screenshots/scr1.png screenshots/scr2.png screenshots/scr3.png screenshots/scr4.png screenshots/scr5.png screenshots/scr6.png screenshots/scr7.png screenshots/scr8.png screenshots/scr9.png screenshots/scrA.png screenshots/scr9.png screenshots/scr9.png screenshots/scr9.png screenshots/scr9.png

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages