← Work experience Machine learning
Transaction risk & fraud detection
Fraud and risk classifiers scoring 1.2M+ transactions a day, where a false positive is a real customer who can't pay. Behavioural features, a threshold change that cut false positives at the same fraud catch rate, explanations analysts can read, and a semantic search over past cases.
- 1.2M+
- Transactions scored per day
- 4.5 → 2.3 hrs
- Data refresh and scoring time
- Down, same catch rate
- False positives
- XGBoost · LightGBM · CatBoost
- Models
Architecture
- 01 Transactions payments, merchants, accounts
- 02 Spark prep Kafka · PySpark · Airflow
- 03 Features frequency, amounts, timing, history
- 04 Classifiers XGBoost · LightGBM · CatBoost
- 05 Explain SHAP · LIME
- 06 Serve FastAPI · Docker · AWS
The problem
Fraud models live between two kinds of failure: missed fraud, and legitimate customers whose payments get blocked. Transaction data is high-volume, full of duplicates and incomplete records, and behaviour varies enormously from one account to the next.
Features first
Transaction and customer-level data was prepared with Python, SQL, Pandas and NumPy, then moved to Apache Spark / PySpark for the volumes involved. Reusable SQL and Python routines turn raw activity into model-ready datasets, so training and validation sets refresh without manual rework. Apache Kafka event streams fed the raw activity, and Apache Airflow with PySpark automated the data refreshes and scoring, cutting refresh time from 4.5 to 2.3 hours. Automated data and score validation checks catch upstream data issues before they reach production scoring.
The features describe behaviour: transaction frequency, payment amounts, merchant activity, customer history, timing patterns and account-level signals.
Models, tuned for the right errors
I compared XGBoost, LightGBM, CatBoost, Random Forest and Logistic Regression, evaluated with AUC-ROC, precision, recall, confusion matrices and cross-validation. The focus was on incorrectly flagged transactions and missed risk cases, not on one headline number. Learning rates, tree depth, regularization and sampling were tuned with Optuna, Grid and Randomized Search.
The models scored 1.2M+ transactions a day. With risk teams I compared decision-threshold scenarios, weighing missed fraud against incorrectly flagged customers. That led to a threshold change that reduced false positives, so fewer legitimate customers were blocked, at the same fraud catch rate.
Making decisions explainable
- SHAP and LIME show risk analysts why a transaction scored high, case by case and across the model.
- Text signals: Hugging Face Transformers, BERT and Sentence Transformers extract classification and semantic signals from customer-support and case text.
- Case search: a semantic search layer with FAISS and OpenSearch lets analysts find similar historical cases without exact phrases.
Delivery
Inference components were containerized with Docker and exposed through FastAPI and REST. Across the lifecycle I used AWS S3, SageMaker, ECS, Glue and Redshift, with MLflow for model history and Redis + Celery for long-running jobs. Thresholds and features were revisited with product, risk and data teams after each testing cycle.