Predict the sales given a set of inputs using only a single endpoint /predict
/domain
: storage of the Schema/router
: layer for handling requests/service
: the name of the file is adapted from a clean architecture set up wherein the services are where the application and business logic is executed/tests
: consists of both functional and load test
/model_store
: it stores the latest model/archive
: storage of previously used model to mimic the functionality of versioning models
/data_store
: stores the training dataset, store details, and unscaled training dataset
/experiments
: makeshift isolated directory for conducting local testing, normally it should be isolated altogether from the deployment to reduce access of the training notebook and environment/utils
: stores the function for automatically saving the trained model in the Model Store
app
├── __init__.py
├── domain
│ ├── __init__.py
│ └── store.py
├── main.py
├── router
│ ├── __init__.py
│ ├── index.py
│ └── predict.py
├── service
│ ├── __init__.py
│ ├── model_loader.py
│ └── preprocessor.py
└── tests
├── __init__.py
├── functional_test
│ ├── __init__.py
│ ├── test_index.py
│ └── test_predict.py
└── load_test
├── __init__.py
└── locustfile.py
data_store
├── store.csv
├── train.csv
└── x_train_unscaled.csv
model_store
├── archive
│ ├── sales_prediction_1.joblib
│ └── sales_prediction_2.joblib
└── sales_prediction_3.joblib
experiments
├── Experiment.ipynb
├── sales-prediction.joblib
└── utils
└── services.py
You may the application through heroku
- Inference endpoint: https://sales-prediction.herokuapp.com/predict
curl -d '{"Store":1111,"DayOfWeek":4,"Date":"2014-07-10","Customers":410,"Open":1,"Promo":0,"StateHoliday":"0","SchoolHoliday":1}' -H "Content-Type: application/json" -X POST https://sales-prediction.herokuapp.com/predict
- API documentation endpoint: https://sales-prediction.herokuapp.com/docs
- Deploying Docker Image to Heroku using Github Action
- Using Github SHA as tags for the docker image
- Commit message conventions
- Enforce Checks before Merging Pull Requests
- Designing Machine Learning Systems and Feature Engineering
- MLE: One-hot encoding
- Sudden change of base docker image from Alpine to slim