Implementation of ctr / cvr models using pytorch or numpy (from scratch).
We use poetry to manage dependencies of repository.
Use poetry with version 2.1.1.
$ poetry --version
Poetry (version 2.1.1)Python version should be 3.11.x.
$ python --version
Python 3.11.11If python version is lower than 3.11, try installing required version using pyenv.
Create virtual environment.
$ poetry env activateIf your global python version is not 3.11, run following command.
$ poetry env use python3.11You can check virtual environment path info and its executable python path using following command.
$ poetry env infoAfter setting up python version, just run following command which will install all the required packages from poetry.lock.
$ poetry installSet up automatic linting using the following commands:
# This command will ensure linting runs automatically every time you commit code.
pre-commit installCurrently, only criteo dataset is supported.
- For non-kaggle data, download it in this link before running experiment and specify file path for
CriteoSearchData - For kaggle data, download it in this link and specify file path for
train.txt.
You can train implemented models using criteo dataset as
$ poetry run python3 src/train_torch.py \
--data_path data/criteo/CriteoSearchData \
--data_name criteo \
--model fm \
--is_test| Model | Dataset | Test loss | Test Macro F1 |
|---|---|---|---|
| Logistic Regression | criteo | TBD | TBD |
| Factorization Machine | criteo | TBD | TBD |
Run following command.
$ poetry run pytest