https://github.com/aavail/ai-workflow-capstone
To run all tests at once:
python -m pytest
To run specific tests:
python -m pytest tests/{filename}
where {filename}
can be test_api.py
, test_logger.py
or test_model.py
.
The scripts
package contains modules to download and clean data, to transform data and build the model(s), to build
loggers and to monitor the model in production.
The data
folder contains:
- some binary files used to plot;
- the folder where models and model configs are saved;
- the folder where training and production datasets are saved.
To build a Docker image:
docker build -t image_name .
To see Docker images:
docker images
To run it:
docker run -p 4000:8080 image_name
then go to http://0.0.0.0:4000/.
To update training and production data, run:
export PYTHONPATH="."
python scripts/utils.py
The new training and production dataframes will be saved in ./data/datasets
.
export PYTHONPATH="."
python scripts/monitoring.py
The score of the model on production data will be printed, and some plots shown.
What could have been done more:
- perform extensive gridsearch for country-specific models
- add confidence intervals estimation to provide a risk metric.
- use a non supervised approachs.
- add more tests.
- take security into account, e.g. using The Adversarial Robustness Toolbox.
- add periodic automatic retraining.