Metadata-Version: 2.1
Name: rectools
Version: 0.0.1
Summary: An easy-to-use Python library for building recommendation systems
Home-page: https://github.com/MobileTeleSystems/RecTools
License: Apache-2.0
Author: Daniil Potapov
Author-email: mars-team@mts.ru
Maintainer: Daniil Potapov
Maintainer-email: mars-team@mts.ru
Requires-Python: >=3.7.1,<3.10.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: all
Provides-Extra: nn
Requires-Dist: Markdown (>=3.2,<3.3)
Requires-Dist: attrs (>=19.1.0,<22.0.0)
Requires-Dist: implicit (==0.4.4)
Requires-Dist: lightfm (>=1.16,<2.0)
Requires-Dist: nmslib (>=2.0.4,<3.0.0)
Requires-Dist: numpy (>=1.19.5,<2.0.0)
Requires-Dist: pandas (>=0.25.3,<2.0.0)
Requires-Dist: pytorch-lightning (>=1.6,<2.0); extra == "nn" or extra == "all"
Requires-Dist: scipy (>=1.5.4,<2.0.0)
Requires-Dist: spotlight @ git+https://github.com/maciejkula/spotlight.git@v0.1.6 ; extra == "nn" or extra == "all"
Requires-Dist: torch (>=1.6,<2.0); extra == "nn" or extra == "all"
Requires-Dist: tqdm (>=4.27.0,<5.0.0)
Requires-Dist: typeguard (>=2.0.1,<3.0.0)
Project-URL: Repository, https://github.com/MobileTeleSystems/RecTools
Description-Content-Type: text/markdown

# RecTools

RecTools is an easy-to-use Python library which makes the process of building recommendation systems easier, 
faster and more structured than ever before.
It includes built in toolkits for data processing and metrics calculation, 
a variety of recommender models, some wrappers for already existing implementations of popular algorithms 
and model selection framework.
The aim is to collect ready-to-use solutions and best practices in one place to make processes 
of creating your first MVP and deploying model to production as fast and easy as possible.

RecTools allows to easily work with dense and sparse features.
It features such basic models as ones based on random suggestions or popularity and more advanced ones, e.g. LightFM.
It also contains a wide variety of metrics to choose from to better suit recommender system to your needs.

For more details, see the [Documentation](https://strategic.pages.mts.ru/esaul/mars/).

## Get started
```python
import pandas as pd
from implicit.nearest_neighbours import TFIDFRecommender
    
from rectools import Columns
from rectools.dataset import Dataset
from rectools.models import ImplicitItemKNNWrapperModel

# 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 = ImplicitItemKNNWrapperModel(TFIDFRecommender(K=10))
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
```

## CICD

На всех ветках запускается stage - test и для TAG build_and_publish_pip_package-->deploy_docs

## Contribution

To install all requirements run
```
make install
```
You must have `python3` and `virtualenv` installed.

For autoformatting run 
```
make autoformat
```

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

For tests run 
```
make test
```

For coverage run 
```
make coverage
```

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

