Skip to content

Commit

Permalink
Updated readme, docs and examples (#115)
Browse files Browse the repository at this point in the history
- Added visualization example
- Fixed empty requests processing in `AppDataStorage`
- Updated README.md
- Fixed doctrings and examples
  • Loading branch information
blondered authored Mar 22, 2024
1 parent 792323a commit 2717b1c
Show file tree
Hide file tree
Showing 11 changed files with 669 additions and 48 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Added
- `VisualApp` and `ItemToItemVisualApp` widgets for visual comparison of recommendations ([#80](https://github.com/MobileTeleSystems/RecTools/pull/80), [#82](https://github.com/MobileTeleSystems/RecTools/pull/82), [#85](https://github.com/MobileTeleSystems/RecTools/pull/85)) (Need examples and readme update)
- `VisualApp` and `ItemToItemVisualApp` widgets for visual comparison of recommendations ([#80](https://github.com/MobileTeleSystems/RecTools/pull/80), [#82](https://github.com/MobileTeleSystems/RecTools/pull/82), [#85](https://github.com/MobileTeleSystems/RecTools/pull/85), [#115](https://github.com/MobileTeleSystems/RecTools/pull/115))
- Methods for conversion `Interactions` to raw form and for getting raw interactions from `Dataset` ([#69](https://github.com/MobileTeleSystems/RecTools/pull/69))
- `AvgRecPopularity (Average Recommendation Popularity)` to `metrics` ([#81](https://github.com/MobileTeleSystems/RecTools/pull/81))
- Added `normalized` parameter to `AvgRecPopularity` metric ([#89](https://github.com/MobileTeleSystems/RecTools/pull/89))
Expand All @@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Bug in `Interactions.from_raw` method ([#58](https://github.com/MobileTeleSystems/RecTools/pull/58))
- Mistakes in formulas for Serendipity and MIUF in docstrings ([#115](https://github.com/MobileTeleSystems/RecTools/pull/115))
- Examples reproducibility on Google Colab ([#115](https://github.com/MobileTeleSystems/RecTools/pull/115))


## [0.4.2] - 01.12.2023
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The default version doesn't contain all the dependencies, because some of them a

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

Install extension:
Expand All @@ -100,6 +101,7 @@ The table below lists recommender models that are available in RecTools.
| [implicit](https://github.com/benfred/implicit) ALS Wrapper | Matrix Factorization | `rectools.models.ImplicitALSWrapperModel` - Alternating Least Squares Matrix Factorizattion algorithm for implicit feedback | Support for user/item features! [Check our boost to metrics](examples/5_benchmark_iALS_with_features.ipynb) |
| [implicit](https://github.com/benfred/implicit) ItemKNN Wrapper | Collaborative Filtering | `rectools.models.ImplicitItemKNNWrapperModel` - Algorithm that calculates item-item similarity matrix using distances between item vectors in user-item interactions matrix | - |
| [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 | 10-25 times faster inference! [Check our boost to inference](examples/6_benchmark_lightfm_inference.ipynb)|
| EASE | Collaborative Filtering | `rectools.models.EASEModel` - Embarassingly Shallow Autoencoders implementation that explicitly calculates dense item-item similarity matrix | - |
| PureSVD | Matrix Factorization | `rectools.models.PureSVDModel` - Truncated Singular Value Decomposition of user-item interactions matrix | - |
| 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 | - |
| Popular | Heuristic | `rectools.models.PopularModel` - Classic baseline which computes popularity of items | Hyperparams (time window, pop computation) |
Expand Down Expand Up @@ -151,13 +153,13 @@ To remove virtual environment run
make clean
```

## RecTools.Team
## RecTools Team

- [Emiliy Feldman](https://github.com/feldlime)
- [Ildar Safilo](https://github.com/irsafilo)
- [Daniil Potapov](https://github.com/sharthZ23)
- [Igor Belkov](https://github.com/OzmundSedler)
- [Artem Senin](https://github.com/artemseninhse)
- [Emiliy Feldman](https://github.com/feldlime) [Maintainer]
- [Daria Tikhonovich](https://github.com/blondered) [Maintainer]
- [Alexander Butenko](https://github.com/iomallach)
- [Mikhail Khasykov](https://github.com/mkhasykov)
- [Daria Tikhonovich](https://github.com/blondered)
- [Andrey Semenov](https://github.com/In48semenov)
- [Mike Sokolov](https://github.com/mikesokolovv)

Previous contributors: [Ildar Safilo](https://github.com/irsafilo) [ex-Maintainer], [Daniil Potapov](https://github.com/sharthZ23) [ex-Maintainer], [Igor Belkov](https://github.com/OzmundSedler), [Artem Senin](https://github.com/artemseninhse), [Mikhail Khasykov](https://github.com/mkhasykov), [Julia Karamnova](https://github.com/JuliaKup)

1 change: 1 addition & 0 deletions docs/source/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ See tutorials here: https://github.com/MobileTeleSystems/RecTools/tree/main/exam
examples/4_dataset_with_features
examples/5_benchmark_iALS_with_features
examples/6_benchmark_lightfm_inference
examples/7_visualization
14 changes: 8 additions & 6 deletions examples/4_dataset_with_features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import threadpoolctl\n",
"\n",
"import numpy as np\n",
"import pandas as pd\n",
"\n",
"from implicit.als import AlternatingLeastSquares\n",
"\n",
"from rectools import Columns\n",
"from rectools.dataset import Dataset\n",
"from rectools.models import ImplicitALSWrapperModel\n",
"\n",
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\" # For implicit ALS"
"# For implicit ALS\n",
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\"\n",
"threadpoolctl.threadpool_limits(1, \"blas\")"
]
},
{
Expand Down Expand Up @@ -794,9 +796,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "rect",
"display_name": ".venv",
"language": "python",
"name": "rect"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -808,7 +810,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
"version": "3.9.12"
},
"toc": {
"base_numbering": 1,
Expand Down
10 changes: 7 additions & 3 deletions examples/5_benchmark_iALS_with_features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"outputs": [],
"source": [
"import os\n",
"import threadpoolctl\n",
"import warnings\n",
"from pathlib import Path\n",
"\n",
Expand All @@ -39,8 +40,11 @@
"from implicit.als import AlternatingLeastSquares\n",
"\n",
"warnings.filterwarnings('ignore')\n",
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\" # For implicit ALS\n",
"sns.set_theme(style=\"whitegrid\")"
"sns.set_theme(style=\"whitegrid\")\n",
"\n",
"# For implicit ALS\n",
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\"\n",
"threadpoolctl.threadpool_limits(1, \"blas\")"
]
},
{
Expand Down Expand Up @@ -1273,7 +1277,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2717b1c

Please sign in to comment.