Skip to content

Commit 508ed62

Browse files
authored
Updated readme, docs and examples (#115)
- Added visualization example - Fixed empty requests processing in `AppDataStorage` - Updated README.md - Fixed doctrings and examples
1 parent 3a2f0fb commit 508ed62

File tree

11 files changed

+669
-48
lines changed

11 files changed

+669
-48
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
## Unreleased
1010

1111
### Added
12-
- `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)
12+
- `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))
1313
- Methods for conversion `Interactions` to raw form and for getting raw interactions from `Dataset` ([#69](https://github.com/MobileTeleSystems/RecTools/pull/69))
1414
- `AvgRecPopularity (Average Recommendation Popularity)` to `metrics` ([#81](https://github.com/MobileTeleSystems/RecTools/pull/81))
1515
- Added `normalized` parameter to `AvgRecPopularity` metric ([#89](https://github.com/MobileTeleSystems/RecTools/pull/89))
@@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

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

2426

2527
## [0.4.2] - 01.12.2023

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The default version doesn't contain all the dependencies, because some of them a
7474

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

7980
Install extension:
@@ -100,6 +101,7 @@ The table below lists recommender models that are available in RecTools.
100101
| [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) |
101102
| [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 | - |
102103
| [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)|
104+
| EASE | Collaborative Filtering | `rectools.models.EASEModel` - Embarassingly Shallow Autoencoders implementation that explicitly calculates dense item-item similarity matrix | - |
103105
| PureSVD | Matrix Factorization | `rectools.models.PureSVDModel` - Truncated Singular Value Decomposition of user-item interactions matrix | - |
104106
| 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 | - |
105107
| Popular | Heuristic | `rectools.models.PopularModel` - Classic baseline which computes popularity of items | Hyperparams (time window, pop computation) |
@@ -151,13 +153,13 @@ To remove virtual environment run
151153
make clean
152154
```
153155

154-
## RecTools.Team
156+
## RecTools Team
155157

156-
- [Emiliy Feldman](https://github.com/feldlime)
157-
- [Ildar Safilo](https://github.com/irsafilo)
158-
- [Daniil Potapov](https://github.com/sharthZ23)
159-
- [Igor Belkov](https://github.com/OzmundSedler)
160-
- [Artem Senin](https://github.com/artemseninhse)
158+
- [Emiliy Feldman](https://github.com/feldlime) [Maintainer]
159+
- [Daria Tikhonovich](https://github.com/blondered) [Maintainer]
161160
- [Alexander Butenko](https://github.com/iomallach)
162-
- [Mikhail Khasykov](https://github.com/mkhasykov)
163-
- [Daria Tikhonovich](https://github.com/blondered)
161+
- [Andrey Semenov](https://github.com/In48semenov)
162+
- [Mike Sokolov](https://github.com/mikesokolovv)
163+
164+
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)
165+

docs/source/tutorials.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ See tutorials here: https://github.com/MobileTeleSystems/RecTools/tree/main/exam
1313
examples/4_dataset_with_features
1414
examples/5_benchmark_iALS_with_features
1515
examples/6_benchmark_lightfm_inference
16+
examples/7_visualization

examples/4_dataset_with_features.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,24 @@
1313
},
1414
{
1515
"cell_type": "code",
16-
"execution_count": 26,
16+
"execution_count": 2,
1717
"metadata": {},
1818
"outputs": [],
1919
"source": [
2020
"import os\n",
21+
"import threadpoolctl\n",
2122
"\n",
2223
"import numpy as np\n",
2324
"import pandas as pd\n",
24-
"\n",
2525
"from implicit.als import AlternatingLeastSquares\n",
2626
"\n",
2727
"from rectools import Columns\n",
2828
"from rectools.dataset import Dataset\n",
2929
"from rectools.models import ImplicitALSWrapperModel\n",
3030
"\n",
31-
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\" # For implicit ALS"
31+
"# For implicit ALS\n",
32+
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\"\n",
33+
"threadpoolctl.threadpool_limits(1, \"blas\")"
3234
]
3335
},
3436
{
@@ -794,9 +796,9 @@
794796
],
795797
"metadata": {
796798
"kernelspec": {
797-
"display_name": "rect",
799+
"display_name": ".venv",
798800
"language": "python",
799-
"name": "rect"
801+
"name": "python3"
800802
},
801803
"language_info": {
802804
"codemirror_mode": {
@@ -808,7 +810,7 @@
808810
"name": "python",
809811
"nbconvert_exporter": "python",
810812
"pygments_lexer": "ipython3",
811-
"version": "3.7.10"
813+
"version": "3.9.12"
812814
},
813815
"toc": {
814816
"base_numbering": 1,

examples/5_benchmark_iALS_with_features.ipynb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"outputs": [],
2525
"source": [
2626
"import os\n",
27+
"import threadpoolctl\n",
2728
"import warnings\n",
2829
"from pathlib import Path\n",
2930
"\n",
@@ -39,8 +40,11 @@
3940
"from implicit.als import AlternatingLeastSquares\n",
4041
"\n",
4142
"warnings.filterwarnings('ignore')\n",
42-
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\" # For implicit ALS\n",
43-
"sns.set_theme(style=\"whitegrid\")"
43+
"sns.set_theme(style=\"whitegrid\")\n",
44+
"\n",
45+
"# For implicit ALS\n",
46+
"os.environ[\"OPENBLAS_NUM_THREADS\"] = \"1\"\n",
47+
"threadpoolctl.threadpool_limits(1, \"blas\")"
4448
]
4549
},
4650
{
@@ -1273,7 +1277,7 @@
12731277
"name": "python",
12741278
"nbconvert_exporter": "python",
12751279
"pygments_lexer": "ipython3",
1276-
"version": "3.7.10"
1280+
"version": "3.9.12"
12771281
}
12781282
},
12791283
"nbformat": 4,

0 commit comments

Comments
 (0)