--- title: recohut keywords: fastai sidebar: home_sidebar nb_path: "nbs/index.ipynb" ---
a python library for building recommender systems.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
To get a local copy up and running follow these simple example steps.
pip install torch
pip install pytorch-lightning
pip install recohut
# import the required modules
from recohut.datasets.movielens import ML1mDataModule
from recohut.models.nmf import NMF
from recohut.trainers.pl_trainer import pl_trainer
# build the dataset
class Args:
def __init__(self):
self.data_dir = '/content/data'
self.min_rating = 4
self.num_negative_samples = 99
self.min_uc = 5
self.min_sc = 5
self.val_p = 0.2
self.test_p = 0.2
self.num_workers = 2
self.normalize = False
self.batch_size = 32
self.seed = 42
self.shuffle = True
self.pin_memory = True
self.drop_last = False
self.split_type = 'stratified'
args = Args()
ds = ML1mDataModule(**args.__dict__)
ds.prepare_data()
# build the model
model = NMF(n_items=ds.data.num_items, n_users=ds.data.num_users, embedding_dim=20)
# train and evaluate the matrix factorization model
pl_trainer(model, ds, max_epochs=5)
Check this quick tutorial.
For more examples, please refer to the Documentation and Tutorials.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE.txt
for more information.
Sparsh A.