This is a project for the subject Machine Learning of CUNEF Master´s in Data Science.
This practice consists of simulating the implementation of the model generated in the fraud practice by means of an API and generating a monitoring dashboard. For this we will have three objectives:
- Generate a Docker environment to work and to be able to run everything correctly saving the dependencies of operating systems, libraries, environments, etc.
- To use Flask to be able to invoke the model generated in the previous practice, so that data is passed to it and it returns the prediction.
- Store in a file of the desired type (csv, json, etc.) all the calls that have been made to the API and the prediction that has been returned, in order to generate a follow-up dashboard.
- Python 3.9.13
- Visual Studio Code
- Jupyter Notebook
- Flask
- Docker
- Power BI
To run the project you could find the full details in info/Informe_Proyecto
. The summary would be:
-
- Create the docker image:
docker build -t docker-api -f Dockerfile .
-
- Predict the values:
docker run docker-api python3 prediction.py
-
- Extract the pickle model, replace 'youthful_hermann' with the name of your random container :
docker cp youthful_hermann:/data/xgb_model_test.pickle .
-
- Introduce it in the Flask folder and execute this prompt:
python app.py
-
- You will be able to acces in your local system through the port displayed.
-
Docker: Utilites to deploy the docker image and obtain the model.
-
Flask: Utilites to deploy in local the model, also the BI inform.
- templates: HTML resources.
-
info: Step by step guide to follow the repository
Victor Viloria Vázquez
- Email: victor.viloria@cunef.edu
- Linkedin: https://www.linkedin.com/in/vicviloria/