This repo contains the code necessary to train and test a TabTransformer model on whether a customer will default on their telco payments.
Model: TabTransformer
- Paper: https://arxiv.org/pdf/2012.06678.pdf
- Github: https://github.com/lucidrains/tab-transformer-pytorch
Library: pytorch-widedeep
- Clone the repository
- Ensure you have Docker Desktop and Postman installed on your machine
- Open a terminal in the directory of the cloned repo
- run
docker build -t <image_name> . - run
docker run -d --name <container_name> -p 80:80 <image_name> - Open Docker Desktop and navigate to Containers/Apps. Make sure the container with
<container_name>is running - Open Postman
- Send a GET request to
http://0.0.0.0:80/accuracyto run the model and retrieve its accuracy- You may select the depth/number of transformers by specifying an integer, otherwise the recommended depth of 6 is used
- E.g. To select depth = 10,
http://0.0.0.0:80/accuracy/10
TabTransformer.ipynb is a Jupyter Notebook that includes more comments and visualisations alongside the code explaining some of my thought process.
You should be able to view them on GitHub without having to run the notebook
DataCleaning&FeatureEngineering.py includes code that generates the pickle files necessary for the predictive model. Does not need to be run before using the API
https://github.com/antecessor/TabTransformer https://github.com/jrzaurin/tabulardl-benchmark https://towardsdatascience.com/understanding-feature-engineering-part-1-continuous-numeric-data-da4e47099a7b