silverstone1903 / loan-approval-prediction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loan Approval API with Monitoring and Load Testing


Table of Contents

Installation

There are only two prerequisites:

Usage

Start

docker-compose up --build -d

Stopping containers

docker-compose down

Container Logs

When running containers with detached mode (-d) they work in the background thus you can't see the flowing logs. If you want to check compose logs with cli you can use logs.

docker-compose logs --tail 50

API Endpoints

Predict-API

There is a single endpoint for the prediction. You can find the endpoint in the endpoints.py file. It takes a json input and returns a prediction as a json response.

Monitoring

Prometheus

Prometheus is used for monitoring. You can find the prometheus config in the monitoring/prometheus.yml file. It scrapes the metrics from the API container.

Grafana

Grafana is used for visualization. You can find the dashboard in the provisioning/dashboards/dashboard.json file. It visualizes the metrics from the prometheus.

Graphana login credentials: user: admin password: pass

Folder Structure

Click to hide/unhide the folder structure.
├── api.py
├── data
│   └── loan_approval_dataset.csv
├── docker-compose.yml
├── load_test
│   ├── data.py
│   └── locustfile.py
├── ml_engineer_case.pdf
├── model
│   └── model.txt
├── monitoring
│   ├── config.monitoring
│   └── prometheus.yml
├── notebooks
│   ├── eda.ipynb
│   ├── modelling.ipynb
│   └── test.ipynb
├── provisioning
│   ├── dashboards
│   │   ├── dashboard.json
│   │   └── dashboard.yaml
│   └── datasources
│       └── datasource.yml
├── readme.md
├── requirements.txt
├── src
│   ├── Dockerfile.app
│   ├── config.py
│   ├── datamodel.py
│   ├── endpoints.py
│   └── utils.py
└── tests
    ├── __init__.py
    ├── pytest.ini
    └── test_main.py

Screenshots

Grafana Dashboard

pytest (Unit Test)

Locust (Load Test)

About


Languages

Language:Jupyter Notebook 89.6%Language:Python 10.4%