How sidd2721/fraud-detect-mini- works
FraudDetect AI serves interactive credit-card fraud screening: a user enters one 29-feature transaction or uploads a labeled/unlabeled CSV; FastAPI validates and routes it through shared inference, which returns a classification, probability, and feature-level explanation for the browser to render. The API also exposes curated samples, static evaluation metrics, model information, and downloadable sample CSV; labeled batch uploads can include live evaluation. Training creates the saved pipeline and demo artifacts. Source excerpts establish the single/batch call paths, while other frontend wiring is only partially sampled.
Main entry points: main.py FastAPI routes · script.js UI and charts · model_train.py Training pipeline · index.html Web interface
Components 10
Browser experience
- Web interface
frontend/index.html - UI and charts
frontend/script.js - Fintech styling
frontend/style.css
API and evaluation
- FastAPI routes
main.py - Evaluation metrics
metrics.json - Labeled samples
labeled_test_data.json
Fraud inference
- Fraud detector
prediction_endpoint.py - Trained pipeline
ml/fraud_model.joblib
Model preparation
- Training pipeline
ml/model_train.py
Other components
- Analyst
Connections 10
- Analyst → Web interface: uses
- Web interface → UI and charts: loads
- UI and charts → FastAPI routes: requests
- FastAPI routes → Fraud detector: invokes inference
- Fraud detector → Trained pipeline: loads pipeline
- FastAPI routes → Evaluation metrics: reads metrics
- FastAPI routes → Labeled samples: reads samples
- Training pipeline → Trained pipeline: saves pipeline
- Training pipeline → Evaluation metrics: writes metrics
- UI and charts → Fintech styling: uses styles