Commit ·
2c04cce
1
Parent(s): 8e70432
README verification
Browse files- README.md +2 -7
- data/production/predictions_log.csv +2 -0
- reports/evidently/drift_report.html +0 -0
README.md
CHANGED
|
@@ -49,10 +49,6 @@ ML Inference Service with Drift Detection/
|
|
| 49 |
|
| 50 |
1. Clone the repository:
|
| 51 |
|
| 52 |
-
```bash
|
| 53 |
-
git clone <repo_url>
|
| 54 |
-
cd ML Inference Service with Drift Detection
|
| 55 |
-
```
|
| 56 |
2. Create a virtual environment and activate it:
|
| 57 |
|
| 58 |
```bash
|
|
@@ -79,7 +75,6 @@ ML Inference Service with Drift Detection/
|
|
| 79 |
2. Open the dashboard:
|
| 80 |
|
| 81 |
* Localhost: [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
|
| 82 |
-
3. Predictions can be submitted via the API `/predict` endpoint (multipart CSV upload).
|
| 83 |
|
| 84 |
## Testing
|
| 85 |
|
|
@@ -94,7 +89,7 @@ ML Inference Service with Drift Detection/
|
|
| 94 |
|
| 95 |
1. **API Layer**: FastAPI routes handle `/predict`, `/dashboard/data` and `/health`. Predictions are appended to `data/production/predictions_log.csv`.
|
| 96 |
2. **Inference Layer**: `Predictor` wraps the model, loads features from `FEATURES_PATH`, and performs batch predictions.
|
| 97 |
-
3. **Background Drift Loop**: Continuously monitors recent predictions (rolling window up to
|
| 98 |
4. **Governance**: Checks metrics like PSI, F1, and regression accuracy against thresholds and logs alerts. Sends notifications via email or Slack (if configured).
|
| 99 |
5. **Dashboard**: Reads `drift_report.json` and displays recent predictions and drift metrics via Plotly charts.
|
| 100 |
|
|
@@ -115,7 +110,7 @@ ML Inference Service with Drift Detection/
|
|
| 115 |
|
| 116 |
## Recommendations / Important Notes
|
| 117 |
|
| 118 |
-
* **CSV Rolling Window**: `MAX_DRIFT_ROWS` limits the predictions log to
|
| 119 |
* **Email Alerts**: SMTP server must be configured; otherwise, alert sending will fail.
|
| 120 |
* **HF Spaces**: The dashboard runs at `/` endpoint by default for compatibility.
|
| 121 |
|
|
|
|
| 49 |
|
| 50 |
1. Clone the repository:
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
2. Create a virtual environment and activate it:
|
| 53 |
|
| 54 |
```bash
|
|
|
|
| 75 |
2. Open the dashboard:
|
| 76 |
|
| 77 |
* Localhost: [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
|
|
|
|
| 78 |
|
| 79 |
## Testing
|
| 80 |
|
|
|
|
| 89 |
|
| 90 |
1. **API Layer**: FastAPI routes handle `/predict`, `/dashboard/data` and `/health`. Predictions are appended to `data/production/predictions_log.csv`.
|
| 91 |
2. **Inference Layer**: `Predictor` wraps the model, loads features from `FEATURES_PATH`, and performs batch predictions.
|
| 92 |
+
3. **Background Drift Loop**: Continuously monitors recent predictions (rolling window up to 9,000 rows), runs feature-level drift checks, and writes results to `reports/evidently/drift_report.json`.
|
| 93 |
4. **Governance**: Checks metrics like PSI, F1, and regression accuracy against thresholds and logs alerts. Sends notifications via email or Slack (if configured).
|
| 94 |
5. **Dashboard**: Reads `drift_report.json` and displays recent predictions and drift metrics via Plotly charts.
|
| 95 |
|
|
|
|
| 110 |
|
| 111 |
## Recommendations / Important Notes
|
| 112 |
|
| 113 |
+
* **CSV Rolling Window**: `MAX_DRIFT_ROWS` limits the predictions log to 9,000 rows. Older rows are removed to prevent oversized files.
|
| 114 |
* **Email Alerts**: SMTP server must be configured; otherwise, alert sending will fail.
|
| 115 |
* **HF Spaces**: The dashboard runs at `/` endpoint by default for compatibility.
|
| 116 |
|
data/production/predictions_log.csv
CHANGED
|
@@ -130,3 +130,5 @@ credit_limit,age,pay_delay_sep,pay_delay_aug,bill_amt_sep,bill_amt_aug,pay_amt_s
|
|
| 130 |
80000.0,35,0,0,48725.0,53095.0,10000.0,10000.0,0,0,0.197687806217314,Low,v1,2026-01-15 17:06:36.488972+00:00
|
| 131 |
50000.0,27,-1,-1,45750.0,1655.0,1655.0,8425.0,0,0,0.0919791368747179,Low,v1,2026-01-15 17:06:42.295385+00:00
|
| 132 |
120000.0,54,-2,-2,0.0,0.0,0.0,0.0,0,0,0.07400624870754548,Low,v1,2026-01-15 17:06:42.295385+00:00
|
|
|
|
|
|
|
|
|
| 130 |
80000.0,35,0,0,48725.0,53095.0,10000.0,10000.0,0,0,0.197687806217314,Low,v1,2026-01-15 17:06:36.488972+00:00
|
| 131 |
50000.0,27,-1,-1,45750.0,1655.0,1655.0,8425.0,0,0,0.0919791368747179,Low,v1,2026-01-15 17:06:42.295385+00:00
|
| 132 |
120000.0,54,-2,-2,0.0,0.0,0.0,0.0,0,0,0.07400624870754548,Low,v1,2026-01-15 17:06:42.295385+00:00
|
| 133 |
+
50000.0,35,0,-1,12000.0,11000.0,3000.0,2500.0,,0,0.20681478861472152,Low,v1,2026-01-16 12:53:17.561287+00:00
|
| 134 |
+
200000.0,42,2,0,60000.0,58000.0,10000.0,9000.0,,0,0.4295814923706167,Low,v1,2026-01-16 12:53:17.561287+00:00
|
reports/evidently/drift_report.html
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|