How tejaskedarpawar/fraud-detection-pipeline works
This repository is a real-time fraud-detection pipeline with two result paths: Kafka-streamed transactions are scored and may become monitored alerts, while API clients can request an individual score and inspect service health and usage metrics. The offline path explores and preprocesses transaction data, then trains and evaluates candidate models for runtime use. The README documents Kafka and Docker orchestration; deployment files are omitted from this runtime map. The graph reflects sampled Python source and documented capabilities; broker wiring beyond the shown Kafka topic operations is not expanded.
Main entry points: consumer.py Fraud scorer · fraud_eda.py Explore and prepare · fraud_model.py Train and evaluate · main.py Scoring and metrics API
Components 13
Offline ML
- Explore and prepare
fraud_eda.py - Prepared splits
- Train and evaluate
fraud_model.py - Selected model
Streaming Detection
- Transaction generator
producer.py - Fraud scorer
consumer.py - Alert monitor
alert_monitor.py
API Serving
- Scoring and metrics API
main.py
Kafka Messaging
- Transactions topic
- Fraud alerts topic
- Kafka broker
Other components
- Data analyst
- API client
Connections 13
- Data analyst → Explore and prepare: provides dataset
- Explore and prepare → Prepared splits: saves splits
- Prepared splits → Train and evaluate: loads splits
- Train and evaluate → Selected model: saves winner
- Selected model → Fraud scorer: loads model
- Selected model → Scoring and metrics API: loads model
- Transaction generator → Kafka broker: publishes transactions
- Kafka broker → Transactions topic: routes messages
- Transactions topic → Fraud scorer: consumes transactions
- Fraud scorer → Kafka broker: publishes fraud alerts
- Kafka broker → Fraud alerts topic: routes alerts
- Fraud alerts topic → Alert monitor: consumes alerts
- API client → Scoring and metrics API: requests scoring or metrics