How olasumboor/fraud-detection works
This repository implements a credit-card fraud detection workflow: transaction data is scaled and split, classifiers are trained and evaluated, XGBoost can be tuned, and a FastAPI service returns fraud probabilities and threshold-based decisions. The notebooks suggest additional analysis and reporting, but their contents were not sampled; the README is empty, so those capabilities and their wiring are not detailed. The graph focuses on behavior evidenced by source and the artifact tree.
Main entry points: train.py Train classifiers · api.py Fraud scoring API · preprocess.py Scale and split · tune.py Tune XGBoost
Components 15
Data preparation
- Scale and split
src/preprocess.py - Processed splits
Model development
- Train classifiers
src/train.py - Model evaluation
src/train.py - Logistic model
models/logistic_regression.joblib - Random forest
models/random_forest.joblib - XGBoost model
models/xgboost.joblib - Tune XGBoost
src/tune.py - Tuned model
models/xgboost_tuned.joblib - Threshold metadata
models/xgboost_tuned_meta.json
Prediction service
- Fraud scoring API
src/api.py - Transaction input
src/api.py - Fraud prediction
src/api.py
Other components
- Credit-card data
- API client
Connections 14
- Credit-card data → Scale and split: reads
- Scale and split → Processed splits: writes
- Processed splits → Train classifiers: loads
- Train classifiers → Model evaluation: evaluates
- Train classifiers → Logistic model: saves
- Train classifiers → Random forest: saves
- Train classifiers → XGBoost model: saves
- Processed splits → Tune XGBoost: tunes on
- Tune XGBoost → Tuned model: saves
- API client → Fraud scoring API: requests score
- Fraud scoring API → Transaction input: validates
- Fraud scoring API → Tuned model: loads
- Fraud scoring API → Threshold metadata: loads
- Fraud scoring API → Fraud prediction: returns