-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from MobileTeleSystems/feature/prettify
Feature/prettify
- Loading branch information
Showing
7 changed files
with
149 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
|
||
## Unreleased | ||
|
||
### Added |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,110 @@ | ||
# RecTools | ||
# 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/workflow/status/MobileTeleSystems/RecTools/Publish?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/workflow/status/MobileTeleSystems/RecTools/Test/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) | ||
[![Telegram](https://img.shields.io/badge/channel-telegram-blue)](https://t.me/RecTools_Support) | ||
|
||
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://rectools.readthedocs.io/) | ||
and [Tutorials](https://github.com/MobileTeleSystems/RecTools/tree/main/examples). | ||
|
||
## 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 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 | ||
``` | ||
|
||
|
||
## Contribution | ||
|
||
To install all requirements run | ||
``` | ||
make install | ||
``` | ||
You must have `python3` and `poetry` 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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
[tool.poetry] | ||
name = "rectools" | ||
name = "RecTools" | ||
version = "0.0.3" | ||
repository = "https://github.com/MobileTeleSystems/RecTools" | ||
readme = "README.md" | ||
description = "An easy-to-use Python library for building recommendation systems" | ||
license = "Apache-2.0" | ||
authors = [ | ||
"Daniil Potapov <[email protected]>", | ||
"Daniil Potapov <[email protected]>", | ||
"Ildar Safilo <[email protected]>", | ||
"Emiliy Feldman <[email protected]", | ||
"Alexander Butenko <[email protected]>", | ||
"Julia Karamnova <[email protected]>", | ||
"Artem Senin <[email protected]>", | ||
"Mikhail Khasykov <[email protected]>", | ||
"Daria Tikhonovich <[email protected]>", | ||
] | ||
maintainers = [ | ||
"Daniil Potapov <[email protected]>", | ||
"Daniil Potapov <[email protected]>", | ||
"Ildar Safilo <[email protected]>", | ||
"Emiliy Feldman <[email protected]", | ||
] | ||
readme = "README.md" | ||
homepage = "https://github.com/MobileTeleSystems/RecTools" | ||
repository = "https://github.com/MobileTeleSystems/RecTools" | ||
documentation = "https://rectools.readthedocs.io" | ||
keywords = [ | ||
"recsys", | ||
"recommendation systems", | ||
"machine learning", | ||
"AI", | ||
"personalization", | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters