RecTools


NameRecTools JSON
Version 0.16.0 PyPI version JSON
download
home_pagehttps://github.com/MobileTeleSystems/RecTools
SummaryAn easy-to-use Python library for building recommendation systems
upload_time2025-07-27 11:24:04
maintainerEmiliy Feldman
docs_urlNone
authorEmiliy Feldman
requires_python<3.14,>=3.9
licenseApache-2.0
keywords recsys recommendation systems machine learning ai personalization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # RecTools

[![Python versions](https://img.shields.io/pypi/pyversions/rectools.svg)](https://pypi.org/project/rectools)
[![PyPI](https://img.shields.io/pypi/v/rectools.svg)](https://pypi.org/project/rectools)
[![Docs](https://img.shields.io/github/actions/workflow/status/MobileTeleSystems/RecTools/publish.yml?label=docs)](https://rectools.readthedocs.io)

[![License](https://img.shields.io/github/license/MobileTeleSystems/RecTools.svg)](https://github.com/MobileTeleSystems/RecTools/blob/main/LICENSE)
[![Coverage](https://img.shields.io/codecov/c/github/MobileTeleSystems/RecTools.svg)](https://app.codecov.io/gh/MobileTeleSystems/RecTools)
[![Tests](https://img.shields.io/github/actions/workflow/status/MobileTeleSystems/RecTools/test.yml?branch=main&label=tests)](https://github.com/MobileTeleSystems/RecTools/actions/workflows/test.yml?query=branch%3Amain++)

[![Contributors](https://img.shields.io/github/contributors/MobileTeleSystems/RecTools.svg)](https://github.com/MobileTeleSystems/RecTools/graphs/contributors)
[![Downloads](https://static.pepy.tech/badge/rectools)](https://pepy.tech/project/rectools)
[![Telegram](https://img.shields.io/badge/channel-telegram-blue)](https://t.me/RecTools_Support)

<p align="center">
  <a href="https://rectools.readthedocs.io/en/stable/">Documentation</a> |
  <a href="https://github.com/MobileTeleSystems/RecTools/tree/main/examples">Examples</a> |
    <a href="https://github.com/MobileTeleSystems/RecTools/tree/main/examples/tutorials">Tutorials</a> |
  <a href="https://github.com/MobileTeleSystems/RecTools/blob/main/CONTRIBUTING.rst">Contributing</a> |
  <a href="https://github.com/MobileTeleSystems/RecTools/releases">Releases</a> |
  <a href="https://github.com/orgs/MobileTeleSystems/projects/1">Developers Board</a>
</p>

RecTools is an easy-to-use Python library which makes the process of building recommender systems easier and
faster than ever before.

## ✨ Highlights: HSTU model released! ✨

**HSTU arhictecture from ["Actions speak louder then words..."](https://arxiv.org/abs/2402.17152) is now available in RecTools as `HSTUModel`:**
- Fully compatible with our  `fit` / `recommend` paradigm and require NO special data processing
- Supports context-aware recommendations in case Relative Time Bias is enabled
- Supports all loss options, item embedding options, category features utilization and other common modular functionality of RecTools transformer models
- In [HSTU tutorial](examples/tutorials/transformers_HSTU_tutorial.ipynb) we show that original metrics reported for HSTU on public Movielens datasets may actually be **underestimated**
- Configurable, customizable, callback-friendly, checkpoints-included, logs-out-of-the-box, custom-validation-ready, multi-gpu-compatible! See  [Transformers Advanced Training User Guide](examples/tutorials/transformers_advanced_training_guide.ipynb) and [Transformers Customization Guide](examples/tutorials/transformers_customization_guide.ipynb)

Plase note that we always compare the quality of our implementations to academic papers results. [Public benchmarks for transformer models SASRec and BERT4Rec](https://github.com/blondered/bert4rec_repro?tab=readme-ov-file#rectools-transformers-benchmark-results) show that RecTools implementations achieve highest scores on multiple datasets compared to other published results.


## Get started

Prepare data with

```shell
wget https://files.grouplens.org/datasets/movielens/ml-1m.zip
unzip ml-1m.zip
```

```python
import pandas as pd
    
from rectools import Columns
from rectools.dataset import Dataset
from rectools.models import SASRecModel

# Read the data
ratings = pd.read_csv(
    "ml-1m/ratings.dat", 
    sep="::",
    engine="python",  # Because of 2-chars separators
    header=None,
    names=[Columns.User, Columns.Item, Columns.Weight, Columns.Datetime],
)
    
# Create dataset
dataset = Dataset.construct(ratings)
    
# Fit model
model = SASRecModel(n_factors=64, epochs=100, loss="sampled_softmax")
model.fit(dataset)

# Make recommendations
recos = model.recommend(
    users=ratings[Columns.User].unique(),
    dataset=dataset,
    k=10,
    filter_viewed=True,
)
```

## Installation

RecTools is on PyPI, so you can use `pip` to install it.
```
pip install rectools
```
The default version doesn't contain all the dependencies, because some of them are needed only for specific functionality. Available user extensions are the following:

- `lightfm`: adds wrapper for LightFM model,
- `torch`: adds models based on neural nets,
- `visuals`: adds visualization tools,
- `nmslib`: adds fast ANN recommenders.

Install extension:
```
pip install rectools[extension-name]
```

Install all extensions:
```
pip install rectools[all]
```


## Recommender Models
The table below lists recommender models that are available in RecTools.  

| Model               | Type | Description (🎏 for user/item features, 🔆 for warm inference, ❄️ for cold inference support)                                                                               | Tutorials & Benchmarks |
|---------------------|----|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| HSTU                | Neural Network | `rectools.models.HSTUModel` - Sequential model with unidirectional pointwise aggregated attention mechanism, incorporating relative attention bias from positional and temporal information, introduced in ["Actions speak louder then words..."](https://arxiv.org/pdf/2402.17152), combined with "Shifted Sequence" training objective as in original public benchmarks<br>🎏                                    | 📓 [HSTU Theory & Practice](examples/tutorials/transformers_HSTU_tutorial.ipynb) <br>  📕 [Transformers Theory & Practice](examples/tutorials/transformers_tutorial.ipynb)<br>  📗 [Advanced training guide](examples/tutorials/transformers_advanced_training_guide.ipynb) <br> 🚀 [Top performance on public datasets](examples/tutorials/transformers_HSTU_tutorial.ipynb)
| SASRec              | Neural Network | `rectools.models.SASRecModel` - Transformer-based sequential model with unidirectional attention mechanism and "Shifted Sequence" training objective <br>🎏                 | 📕 [Transformers Theory & Practice](examples/tutorials/transformers_tutorial.ipynb)<br>  📗 [Advanced training guide](examples/tutorials/transformers_advanced_training_guide.ipynb) <br>  📘 [Customization guide](examples/tutorials/transformers_customization_guide.ipynb) <br> 🚀 [Top performance on public benchmarks](https://github.com/blondered/bert4rec_repro?tab=readme-ov-file#rectools-transformers-benchmark-results) |
| BERT4Rec            | Neural Network | `rectools.models.BERT4RecModel` - Transformer-based sequential model with bidirectional attention mechanism and "MLM" (masked item) training objective <br>🎏               | 📕 [Transformers Theory & Practice](examples/tutorials/transformers_tutorial.ipynb)<br>  📗 [Advanced training guide](examples/tutorials/transformers_advanced_training_guide.ipynb) <br>  📘 [Customization guide](examples/tutorials/transformers_customization_guide.ipynb) <br> 🚀 [Top performance on public benchmarks](https://github.com/blondered/bert4rec_repro?tab=readme-ov-file#rectools-transformers-benchmark-results) |
| [implicit](https://github.com/benfred/implicit) ALS Wrapper | Matrix Factorization | `rectools.models.ImplicitALSWrapperModel` - Alternating Least Squares Matrix Factorizattion algorithm for implicit feedback. <br>🎏                                         | 📙 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#Implicit-ALS)<br> 🚀 [50% boost to metrics with user & item features](examples/5_benchmark_iALS_with_features.ipynb) |
| [implicit](https://github.com/benfred/implicit) BPR-MF Wrapper | Matrix Factorization | `rectools.models.ImplicitBPRWrapperModel` - Bayesian Personalized Ranking Matrix Factorization algorithm.                                                                   | 📙 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#Bayesian-Personalized-Ranking-Matrix-Factorization-(BPR-MF)) |
| [implicit](https://github.com/benfred/implicit) ItemKNN Wrapper | Nearest Neighbours | `rectools.models.ImplicitItemKNNWrapperModel` - Algorithm that calculates item-item similarity matrix using distances between item vectors in user-item interactions matrix | 📙 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#ItemKNN) |
| [LightFM](https://github.com/lyst/lightfm) Wrapper | Matrix Factorization | `rectools.models.LightFMWrapperModel` - Hybrid matrix factorization algorithm which utilises user and item features and supports a variety of losses.<br>🎏 🔆 ❄️           | 📙 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#LightFM)<br>🚀 [10-25 times faster inference with RecTools](examples/6_benchmark_lightfm_inference.ipynb)|
| EASE                | Linear Autoencoder | `rectools.models.EASEModel` - Embarassingly Shallow Autoencoders implementation that explicitly calculates dense item-item similarity matrix                                | 📙 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#EASE) |
| PureSVD             | Matrix Factorization | `rectools.models.PureSVDModel` - Truncated Singular Value Decomposition of user-item interactions matrix                                                                    | 📙 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#PureSVD) |
| DSSM                | Neural Network | `rectools.models.DSSMModel` - Two-tower Neural model that learns user and item embeddings utilising their explicit features and learning on triplet loss.<br>🎏 🔆          | - |
| Popular             | Heuristic | `rectools.models.PopularModel` - Classic baseline which computes popularity of items and also accepts params like time window and type of popularity computation.<br>❄️     | - |
| Popular in Category | Heuristic | `rectools.models.PopularInCategoryModel` - Model that computes poularity within category and applies mixing strategy to increase Diversity.<br>❄️                           | - |
| Random              |  Heuristic | `rectools.models.RandomModel` - Simple random algorithm useful to benchmark Novelty, Coverage, etc.<br>❄️                                                                   | - |

- All of the models follow the same interface. **No exceptions**
- No need for manual creation of sparse matrixes, torch dataloaders or mapping ids. Preparing data for models is as simple as `dataset = Dataset.construct(interactions_df)`
- Fitting any model is as simple as `model.fit(dataset)`
- For getting recommendations `filter_viewed` and `items_to_recommend` options are available
- For item-to-item recommendations use `recommend_to_items` method
- For feeding user/item features to model just specify dataframes when constructing `Dataset`. [Check our example](examples/4_dataset_with_features.ipynb)
- For warm / cold inference just provide all required ids in `users` or `target_items` parameters of `recommend` or `recommend_to_items` methods and make sure you have features in the dataset for warm users/items. **Nothing else is needed, everything works out of the box.**
- Our models can be initialized from configs and have useful methods like `get_config`, `get_params`, `save`, `load`. Common functions `model_from_config`, `model_from_params` and `load_model` are available. [Check our example](examples/9_model_configs_and_saving.ipynb)


## Extended validation tools

### `calc_metrics` for classification, ranking, "beyond-accuracy", DQ, popularity bias and between-model metrics


[User guide](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/3_metrics.ipynb) | [Documentation](https://rectools.readthedocs.io/en/stable/features.html#metrics)


### `DebiasConfig` for debiased metrics calculation

[User guide](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/8_debiased_metrics.ipynb) | [Documentation](https://rectools.readthedocs.io/en/stable/api/rectools.metrics.debias.DebiasConfig.html)

### `cross_validate` for model metrics comparison


[User guide](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/2_cross_validation.ipynb) 


### `VisualApp` for model recommendations comparison

<img src="https://recsysart.ru/images/visual_app.gif" width=500>


[Example](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/7_visualization.ipynb) | [Demo](https://recsysart.ru/voila/) | [Documentation](https://rectools.readthedocs.io/en/stable/api/rectools.visuals.visual_app.VisualApp.html)



### `MetricsApp` for metrics trade-off analysis


<img src="https://recsysart.ru/images/metrics_app.gif" width=600>

[Example](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/2_cross_validation.ipynb) |
[Documentation](https://rectools.readthedocs.io/en/stable/api/rectools.visuals.metrics_app.MetricsApp.html)


## Contribution
[Contributing guide](CONTRIBUTING.rst)

To install all requirements
- you must have `python3` and `poetry` installed
- make sure you have no active virtual environments (deactivate conda `base` if applicable)
- run
```
make install
```


For autoformatting run 
```
make format
```

For linters check run 
```
make lint
```

For tests run 
```
make test
```

For coverage run 
```
make coverage
```

To remove virtual environment run
```
make clean
```

## RecTools Team

- [Emiliy Feldman](https://github.com/feldlime) [Maintainer]
- [Daria Tikhonovich](https://github.com/blondered) [Maintainer]
- [Andrey Semenov](https://github.com/In48semenov)
- [Mike Sokolov](https://github.com/mikesokolovv)
- [Maya Spirina](https://github.com/spirinamayya)
- [Grigoriy Gusarov](https://github.com/Gooogr)
- [Aki Ariga](https://github.com/chezou)
- [Nikolay Undalov](https://github.com/nsundalov)
- [Aleksey Kuzin](https://github.com/teodor-r)

Previous contributors: [Ildar Safilo](https://github.com/irsafilo) [ex-Maintainer], [Daniil Potapov](https://github.com/sharthZ23) [ex-Maintainer], [Alexander Butenko](https://github.com/iomallach), [Igor Belkov](https://github.com/OzmundSedler), [Artem Senin](https://github.com/artemseninhse), [Mikhail Khasykov](https://github.com/mkhasykov), [Julia Karamnova](https://github.com/JuliaKup), [Maxim Lukin](https://github.com/groundmax), [Yuri Ulianov](https://github.com/yukeeul), [Egor Kratkov](https://github.com/jegorus), [Azat Sibagatulin](https://github.com/azatnv), [Vadim Vetrov](https://github.com/Waujito)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MobileTeleSystems/RecTools",
    "name": "RecTools",
    "maintainer": "Emiliy Feldman",
    "docs_url": null,
    "requires_python": "<3.14,>=3.9",
    "maintainer_email": "feldlime@yandex.ru",
    "keywords": "recsys, recommendation systems, machine learning, AI, personalization",
    "author": "Emiliy Feldman",
    "author_email": "feldlime@yandex.ru",
    "download_url": "https://files.pythonhosted.org/packages/20/fe/e65ea287f36321fd1b003c334b7d15bb0a3966c8858947d9508c88759606/rectools-0.16.0.tar.gz",
    "platform": null,
    "description": "# RecTools\n\n[![Python versions](https://img.shields.io/pypi/pyversions/rectools.svg)](https://pypi.org/project/rectools)\n[![PyPI](https://img.shields.io/pypi/v/rectools.svg)](https://pypi.org/project/rectools)\n[![Docs](https://img.shields.io/github/actions/workflow/status/MobileTeleSystems/RecTools/publish.yml?label=docs)](https://rectools.readthedocs.io)\n\n[![License](https://img.shields.io/github/license/MobileTeleSystems/RecTools.svg)](https://github.com/MobileTeleSystems/RecTools/blob/main/LICENSE)\n[![Coverage](https://img.shields.io/codecov/c/github/MobileTeleSystems/RecTools.svg)](https://app.codecov.io/gh/MobileTeleSystems/RecTools)\n[![Tests](https://img.shields.io/github/actions/workflow/status/MobileTeleSystems/RecTools/test.yml?branch=main&label=tests)](https://github.com/MobileTeleSystems/RecTools/actions/workflows/test.yml?query=branch%3Amain++)\n\n[![Contributors](https://img.shields.io/github/contributors/MobileTeleSystems/RecTools.svg)](https://github.com/MobileTeleSystems/RecTools/graphs/contributors)\n[![Downloads](https://static.pepy.tech/badge/rectools)](https://pepy.tech/project/rectools)\n[![Telegram](https://img.shields.io/badge/channel-telegram-blue)](https://t.me/RecTools_Support)\n\n<p align=\"center\">\n  <a href=\"https://rectools.readthedocs.io/en/stable/\">Documentation</a> |\n  <a href=\"https://github.com/MobileTeleSystems/RecTools/tree/main/examples\">Examples</a> |\n    <a href=\"https://github.com/MobileTeleSystems/RecTools/tree/main/examples/tutorials\">Tutorials</a> |\n  <a href=\"https://github.com/MobileTeleSystems/RecTools/blob/main/CONTRIBUTING.rst\">Contributing</a> |\n  <a href=\"https://github.com/MobileTeleSystems/RecTools/releases\">Releases</a> |\n  <a href=\"https://github.com/orgs/MobileTeleSystems/projects/1\">Developers Board</a>\n</p>\n\nRecTools is an easy-to-use Python library which makes the process of building recommender systems easier and\nfaster than ever before.\n\n## \u2728 Highlights: HSTU model released! \u2728\n\n**HSTU arhictecture from [\"Actions speak louder then words...\"](https://arxiv.org/abs/2402.17152) is now available in RecTools as `HSTUModel`:**\n- Fully compatible with our  `fit` / `recommend` paradigm and require NO special data processing\n- Supports context-aware recommendations in case Relative Time Bias is enabled\n- Supports all loss options, item embedding options, category features utilization and other common modular functionality of RecTools transformer models\n- In [HSTU tutorial](examples/tutorials/transformers_HSTU_tutorial.ipynb) we show that original metrics reported for HSTU on public Movielens datasets may actually be **underestimated**\n- Configurable, customizable, callback-friendly, checkpoints-included, logs-out-of-the-box, custom-validation-ready, multi-gpu-compatible! See  [Transformers Advanced Training User Guide](examples/tutorials/transformers_advanced_training_guide.ipynb) and [Transformers Customization Guide](examples/tutorials/transformers_customization_guide.ipynb)\n\nPlase note that we always compare the quality of our implementations to academic papers results. [Public benchmarks for transformer models SASRec and BERT4Rec](https://github.com/blondered/bert4rec_repro?tab=readme-ov-file#rectools-transformers-benchmark-results) show that RecTools implementations achieve highest scores on multiple datasets compared to other published results.\n\n\n## Get started\n\nPrepare data with\n\n```shell\nwget https://files.grouplens.org/datasets/movielens/ml-1m.zip\nunzip ml-1m.zip\n```\n\n```python\nimport pandas as pd\n    \nfrom rectools import Columns\nfrom rectools.dataset import Dataset\nfrom rectools.models import SASRecModel\n\n# Read the data\nratings = pd.read_csv(\n    \"ml-1m/ratings.dat\", \n    sep=\"::\",\n    engine=\"python\",  # Because of 2-chars separators\n    header=None,\n    names=[Columns.User, Columns.Item, Columns.Weight, Columns.Datetime],\n)\n    \n# Create dataset\ndataset = Dataset.construct(ratings)\n    \n# Fit model\nmodel = SASRecModel(n_factors=64, epochs=100, loss=\"sampled_softmax\")\nmodel.fit(dataset)\n\n# Make recommendations\nrecos = model.recommend(\n    users=ratings[Columns.User].unique(),\n    dataset=dataset,\n    k=10,\n    filter_viewed=True,\n)\n```\n\n## Installation\n\nRecTools is on PyPI, so you can use `pip` to install it.\n```\npip install rectools\n```\nThe default version doesn't contain all the dependencies, because some of them are needed only for specific functionality. Available user extensions are the following:\n\n- `lightfm`: adds wrapper for LightFM model,\n- `torch`: adds models based on neural nets,\n- `visuals`: adds visualization tools,\n- `nmslib`: adds fast ANN recommenders.\n\nInstall extension:\n```\npip install rectools[extension-name]\n```\n\nInstall all extensions:\n```\npip install rectools[all]\n```\n\n\n## Recommender Models\nThe table below lists recommender models that are available in RecTools.  \n\n| Model               | Type | Description (\ud83c\udf8f for user/item features, \ud83d\udd06 for warm inference, \u2744\ufe0f for cold inference support)                                                                               | Tutorials & Benchmarks |\n|---------------------|----|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|\n| HSTU                | Neural Network | `rectools.models.HSTUModel` - Sequential model with unidirectional pointwise aggregated attention mechanism, incorporating relative attention bias from positional and temporal information, introduced in [\"Actions speak louder then words...\"](https://arxiv.org/pdf/2402.17152), combined with \"Shifted Sequence\" training objective as in original public benchmarks<br>\ud83c\udf8f                                    | \ud83d\udcd3 [HSTU Theory & Practice](examples/tutorials/transformers_HSTU_tutorial.ipynb) <br>  \ud83d\udcd5 [Transformers Theory & Practice](examples/tutorials/transformers_tutorial.ipynb)<br>  \ud83d\udcd7 [Advanced training guide](examples/tutorials/transformers_advanced_training_guide.ipynb) <br> \ud83d\ude80 [Top performance on public datasets](examples/tutorials/transformers_HSTU_tutorial.ipynb)\n| SASRec              | Neural Network | `rectools.models.SASRecModel` - Transformer-based sequential model with unidirectional attention mechanism and \"Shifted Sequence\" training objective <br>\ud83c\udf8f                 | \ud83d\udcd5 [Transformers Theory & Practice](examples/tutorials/transformers_tutorial.ipynb)<br>  \ud83d\udcd7 [Advanced training guide](examples/tutorials/transformers_advanced_training_guide.ipynb) <br>  \ud83d\udcd8 [Customization guide](examples/tutorials/transformers_customization_guide.ipynb) <br> \ud83d\ude80 [Top performance on public benchmarks](https://github.com/blondered/bert4rec_repro?tab=readme-ov-file#rectools-transformers-benchmark-results) |\n| BERT4Rec            | Neural Network | `rectools.models.BERT4RecModel` - Transformer-based sequential model with bidirectional attention mechanism and \"MLM\" (masked item) training objective <br>\ud83c\udf8f               | \ud83d\udcd5 [Transformers Theory & Practice](examples/tutorials/transformers_tutorial.ipynb)<br>  \ud83d\udcd7 [Advanced training guide](examples/tutorials/transformers_advanced_training_guide.ipynb) <br>  \ud83d\udcd8 [Customization guide](examples/tutorials/transformers_customization_guide.ipynb) <br> \ud83d\ude80 [Top performance on public benchmarks](https://github.com/blondered/bert4rec_repro?tab=readme-ov-file#rectools-transformers-benchmark-results) |\n| [implicit](https://github.com/benfred/implicit) ALS Wrapper | Matrix Factorization | `rectools.models.ImplicitALSWrapperModel` - Alternating Least Squares Matrix Factorizattion algorithm for implicit feedback. <br>\ud83c\udf8f                                         | \ud83d\udcd9 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#Implicit-ALS)<br> \ud83d\ude80 [50% boost to metrics with user & item features](examples/5_benchmark_iALS_with_features.ipynb) |\n| [implicit](https://github.com/benfred/implicit) BPR-MF Wrapper | Matrix Factorization | `rectools.models.ImplicitBPRWrapperModel` - Bayesian Personalized Ranking Matrix Factorization algorithm.                                                                   | \ud83d\udcd9 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#Bayesian-Personalized-Ranking-Matrix-Factorization-(BPR-MF)) |\n| [implicit](https://github.com/benfred/implicit) ItemKNN Wrapper | Nearest Neighbours | `rectools.models.ImplicitItemKNNWrapperModel` - Algorithm that calculates item-item similarity matrix using distances between item vectors in user-item interactions matrix | \ud83d\udcd9 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#ItemKNN) |\n| [LightFM](https://github.com/lyst/lightfm) Wrapper | Matrix Factorization | `rectools.models.LightFMWrapperModel` - Hybrid matrix factorization algorithm which utilises user and item features and supports a variety of losses.<br>\ud83c\udf8f \ud83d\udd06 \u2744\ufe0f           | \ud83d\udcd9 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#LightFM)<br>\ud83d\ude80 [10-25 times faster inference with RecTools](examples/6_benchmark_lightfm_inference.ipynb)|\n| EASE                | Linear Autoencoder | `rectools.models.EASEModel` - Embarassingly Shallow Autoencoders implementation that explicitly calculates dense item-item similarity matrix                                | \ud83d\udcd9 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#EASE) |\n| PureSVD             | Matrix Factorization | `rectools.models.PureSVDModel` - Truncated Singular Value Decomposition of user-item interactions matrix                                                                    | \ud83d\udcd9 [Theory & Practice](https://rectools.readthedocs.io/en/latest/examples/tutorials/baselines_extended_tutorial.html#PureSVD) |\n| DSSM                | Neural Network | `rectools.models.DSSMModel` - Two-tower Neural model that learns user and item embeddings utilising their explicit features and learning on triplet loss.<br>\ud83c\udf8f \ud83d\udd06          | - |\n| Popular             | Heuristic | `rectools.models.PopularModel` - Classic baseline which computes popularity of items and also accepts params like time window and type of popularity computation.<br>\u2744\ufe0f     | - |\n| Popular in Category | Heuristic | `rectools.models.PopularInCategoryModel` - Model that computes poularity within category and applies mixing strategy to increase Diversity.<br>\u2744\ufe0f                           | - |\n| Random              |  Heuristic | `rectools.models.RandomModel` - Simple random algorithm useful to benchmark Novelty, Coverage, etc.<br>\u2744\ufe0f                                                                   | - |\n\n- All of the models follow the same interface. **No exceptions**\n- No need for manual creation of sparse matrixes, torch dataloaders or mapping ids. Preparing data for models is as simple as `dataset = Dataset.construct(interactions_df)`\n- Fitting any model is as simple as `model.fit(dataset)`\n- For getting recommendations `filter_viewed` and `items_to_recommend` options are available\n- For item-to-item recommendations use `recommend_to_items` method\n- For feeding user/item features to model just specify dataframes when constructing `Dataset`. [Check our example](examples/4_dataset_with_features.ipynb)\n- For warm / cold inference just provide all required ids in `users` or `target_items` parameters of `recommend` or `recommend_to_items` methods and make sure you have features in the dataset for warm users/items. **Nothing else is needed, everything works out of the box.**\n- Our models can be initialized from configs and have useful methods like `get_config`, `get_params`, `save`, `load`. Common functions `model_from_config`, `model_from_params` and `load_model` are available. [Check our example](examples/9_model_configs_and_saving.ipynb)\n\n\n## Extended validation tools\n\n### `calc_metrics` for classification, ranking, \"beyond-accuracy\", DQ, popularity bias and between-model metrics\n\n\n[User guide](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/3_metrics.ipynb) | [Documentation](https://rectools.readthedocs.io/en/stable/features.html#metrics)\n\n\n### `DebiasConfig` for debiased metrics calculation\n\n[User guide](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/8_debiased_metrics.ipynb) | [Documentation](https://rectools.readthedocs.io/en/stable/api/rectools.metrics.debias.DebiasConfig.html)\n\n### `cross_validate` for model metrics comparison\n\n\n[User guide](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/2_cross_validation.ipynb) \n\n\n### `VisualApp` for model recommendations comparison\n\n<img src=\"https://recsysart.ru/images/visual_app.gif\" width=500>\n\n\n[Example](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/7_visualization.ipynb) | [Demo](https://recsysart.ru/voila/) | [Documentation](https://rectools.readthedocs.io/en/stable/api/rectools.visuals.visual_app.VisualApp.html)\n\n\n\n### `MetricsApp` for metrics trade-off analysis\n\n\n<img src=\"https://recsysart.ru/images/metrics_app.gif\" width=600>\n\n[Example](https://github.com/MobileTeleSystems/RecTools/blob/main/examples/2_cross_validation.ipynb) |\n[Documentation](https://rectools.readthedocs.io/en/stable/api/rectools.visuals.metrics_app.MetricsApp.html)\n\n\n## Contribution\n[Contributing guide](CONTRIBUTING.rst)\n\nTo install all requirements\n- you must have `python3` and `poetry` installed\n- make sure you have no active virtual environments (deactivate conda `base` if applicable)\n- run\n```\nmake install\n```\n\n\nFor autoformatting run \n```\nmake format\n```\n\nFor linters check run \n```\nmake lint\n```\n\nFor tests run \n```\nmake test\n```\n\nFor coverage run \n```\nmake coverage\n```\n\nTo remove virtual environment run\n```\nmake clean\n```\n\n## RecTools Team\n\n- [Emiliy Feldman](https://github.com/feldlime) [Maintainer]\n- [Daria Tikhonovich](https://github.com/blondered) [Maintainer]\n- [Andrey Semenov](https://github.com/In48semenov)\n- [Mike Sokolov](https://github.com/mikesokolovv)\n- [Maya Spirina](https://github.com/spirinamayya)\n- [Grigoriy Gusarov](https://github.com/Gooogr)\n- [Aki Ariga](https://github.com/chezou)\n- [Nikolay Undalov](https://github.com/nsundalov)\n- [Aleksey Kuzin](https://github.com/teodor-r)\n\nPrevious contributors: [Ildar Safilo](https://github.com/irsafilo) [ex-Maintainer], [Daniil Potapov](https://github.com/sharthZ23) [ex-Maintainer], [Alexander Butenko](https://github.com/iomallach), [Igor Belkov](https://github.com/OzmundSedler), [Artem Senin](https://github.com/artemseninhse), [Mikhail Khasykov](https://github.com/mkhasykov), [Julia Karamnova](https://github.com/JuliaKup), [Maxim Lukin](https://github.com/groundmax), [Yuri Ulianov](https://github.com/yukeeul), [Egor Kratkov](https://github.com/jegorus), [Azat Sibagatulin](https://github.com/azatnv), [Vadim Vetrov](https://github.com/Waujito)\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "An easy-to-use Python library for building recommendation systems",
    "version": "0.16.0",
    "project_urls": {
        "Documentation": "https://rectools.readthedocs.io",
        "Homepage": "https://github.com/MobileTeleSystems/RecTools",
        "Repository": "https://github.com/MobileTeleSystems/RecTools"
    },
    "split_keywords": [
        "recsys",
        " recommendation systems",
        " machine learning",
        " ai",
        " personalization"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "40fd04d79020a6c3f6e517ae19591b74f9cfd969c4e1ff9cffb9a5e13146ba3c",
                "md5": "a6ab678e5ed1f60e796814c3fe66c2e2",
                "sha256": "c7b13ae9afe81dcfe557a08537ccb3a3e3b7d90e88e268ecef13d40088c9e9cb"
            },
            "downloads": -1,
            "filename": "rectools-0.16.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a6ab678e5ed1f60e796814c3fe66c2e2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.9",
            "size": 220377,
            "upload_time": "2025-07-27T11:24:02",
            "upload_time_iso_8601": "2025-07-27T11:24:02.974842Z",
            "url": "https://files.pythonhosted.org/packages/40/fd/04d79020a6c3f6e517ae19591b74f9cfd969c4e1ff9cffb9a5e13146ba3c/rectools-0.16.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "20fee65ea287f36321fd1b003c334b7d15bb0a3966c8858947d9508c88759606",
                "md5": "0a37889dfb870772bcc7d9fee9e4970e",
                "sha256": "d2ead12a3b383f46d451e333647c3bbde1fed8a53e352a56975f1d5ffee19198"
            },
            "downloads": -1,
            "filename": "rectools-0.16.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0a37889dfb870772bcc7d9fee9e4970e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.9",
            "size": 150685,
            "upload_time": "2025-07-27T11:24:04",
            "upload_time_iso_8601": "2025-07-27T11:24:04.961456Z",
            "url": "https://files.pythonhosted.org/packages/20/fe/e65ea287f36321fd1b003c334b7d15bb0a3966c8858947d9508c88759606/rectools-0.16.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-27 11:24:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MobileTeleSystems",
    "github_project": "RecTools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rectools"
}
        
Elapsed time: 2.55373s