How harshkaushik2203/fraud-detection-classifier works
The product develops a fraud classifier for highly imbalanced transactions, selects a business-cost threshold, and serves predictions through FastAPI. The README documents preprocessing, baseline and imbalance-handling comparisons, and threshold tuning; their implementation is represented at the existing notebooks/ directory because notebook source was not sampled. The sampled API shows request validation, amount scaling, model scoring, and threshold-based decisions. Training-stage connections follow the README; runtime connections follow api/main.py. This map omits tests and delivery tooling.
Main entry points: main.py Prediction and health API · notebooks Data preprocessing · config.py Runtime configuration · xgb_fraud_model.joblib Fraud classifier
Components 10
Model development
- Data preprocessing
notebooks - Baseline model
notebooks - Imbalance comparison
notebooks - Cost threshold tuning
notebooks
Prediction API
- Prediction and health API
api/main.py - Request and response schemas
api/schemas.py
Runtime configuration
- Runtime configuration
src/config.py
Model artifacts
- Fraud classifier
models/xgb_fraud_model.joblib - Amount scaler
models/amount_scaler.joblib
Other components
- Transaction caller
Connections 11
- Data preprocessing → Baseline model: prepares data for
README.md - Data preprocessing → Imbalance comparison: prepares data for
README.md - Imbalance comparison → Cost threshold tuning: provides probabilities to
README.md - Transaction caller → Prediction and health API: submits transaction
README.md - Prediction and health API → Request and response schemas: validates and formats
api/main.py - Prediction and health API → Runtime configuration: reads paths and threshold
api/main.py - Prediction and health API → Amount scaler: loads and transforms amount with
api/main.py - Prediction and health API → Fraud classifier: loads and scores with
api/main.py - Prediction and health API → Transaction caller: returns prediction
README.md - Baseline model → Fraud classifier: compares trained approaches
- Cost threshold tuning → Runtime configuration: sets decision threshold
README.md