Implementation of Embarrassingly Shallow Autoencoders (Harald Steck) in PyTorch
* Adapted from: https://github.com/Darel13712/ease_rec
* Paper: https://arxiv.org/abs/1905.03375
* Papers with Code: https://paperswithcode.com/sota/collaborative-filtering-on-million-song
This code is currently SOTA on the Million Song challenge on Papers With Code. It utilizes a simple closed-form solution for a recommendation problem. This PyTorch implementation is much faster than the original Numpy version.
te_implicit = TorchEASE(df, user_col="user", item_col="item")te_implicit.fit()predictions = te_implicity.predict_all(predict_df)
te_explicit = TorchEASE(df, user_col="user", item_col="item", score_col="rating")te_explicit.fit()predictions = te_explicit.predict_all(predict_df)
- Put your data files into
data/ - From a terminal window, call
python train.py {TRAIN.csv} {TO_PRED.csv} {USER_COLUMN_NAME} {ITEM_COLUMN_NAME} {[optional]SCORE_COLUMN_NAME} - Predictions are pushed to
predictions/output.csv
Example usage:
python train.py training.csv users.csv username book_name book_score
Tuning the regularization parameter on scales from 1E2 - 1E3 seems to be effective