Data Science Portfolio โ€“ Esmaeil Pourjavad

Showcasing professional and self-driven projects in Data Science

View on GitHub

๐Ÿ’ณ Fraud Detection with Machine Learning on Google Cloud

๐Ÿ“Œ Overview

This project was completed as part of a Google Cloud Skills Boost lab.
The objective was to detect fraudulent financial transactions using machine learning on Google Cloud Platform (GCP) with both supervised and unsupervised approaches.

The dataset (โ‰ˆ228k transactions, originally from Kaggle) contains transaction type, amount, origin/destination balances, and a fraud label (isFraud).
The challenge is highly imbalanced (fraud <1%), typical of real-world fraud detection.


โš™๏ธ Workflow

  1. Data Engineering & Exploration
    • Ingested raw CSV into BigQuery via Cloud Storage.
    • Explored data distributions (fraud by type, transaction imbalances).
    • Identified that fraud mainly occurs in TRANSFER and CASH_OUT.
  2. Feature Engineering
    • Created new features (origZeroFlag, destZeroFlag, amountError) to capture abnormal balance behaviors.
    • Applied undersampling to reduce class imbalance.
    • Partitioned into train, validate, and test datasets (~20% test holdout).
  3. Modeling
    • Unsupervised: Trained k-means clustering for anomaly detection, profiled clusters with high fraud density.
    • Supervised:
      • Logistic Regression (baseline)
      • Boosted Tree Classifier (gradient boosting) โ†’ selected champion model.
  4. Evaluation
    • Compared models using precision, recall, F1 score, accuracy, ROC/AUC.
    • Boosted Trees outperformed logistic regression with higher AUC and better fraud recall.
    • Fraud detection event rate increased by >95% compared to raw test data.
  5. Prediction
    • Deployed champion model in BigQuery ML.
    • Scored test dataset, predicting fraudulent transactions with probability thresholds.

๐Ÿ“Š Tech Stack


๐Ÿ“Š Model Training & Evaluation

During this project, I trained supervised models in BigQuery ML to detect fraudulent transactions.
The evaluation metrics and curves below illustrate model performance:

BigQuery ML Model Evaluation
Evaluation of logistic regression classifier in BigQuery ML

Key Metrics

Visual Insights

๐Ÿ“‚ Code Snippets


๐Ÿ“ Skills Gained