← Back to portfolio

Credit Card Fraud Detection

Fraud detection on a highly imbalanced dataset, benchmarking an SVM against a Decision Tree with ROC-AUC.

SVMDecision TreeROC-AUCImbalanced DataScikit-learn

Problem

Fraud is rare — often well under 1% of transactions — so a model that labels everything "legitimate" still scores high accuracy while catching zero fraud. Detecting the rare positive class needs imbalance-aware training and a metric that the majority class can't game.

Approach

Built a full pipeline on PCA-anonymized transaction features: standardized and L1-normalized the inputs, corrected the class imbalance with per-sample weights (compute_sample_weight) instead of naive resampling, and trained a DecisionTreeClassifier and a LinearSVC head-to-head. Evaluated on ROC-AUC rather than accuracy, then studied how keeping only the most correlated features shifts each model differently.

Results

  • Benchmarked Decision Tree vs LinearSVC on ROC-AUC — the metric that stays honest under extreme class imbalance
  • Handled imbalance with sample weighting rather than resampling
  • Quantified how top-correlated-feature selection changes each model

Want the full picture, or think this kind of work fits a role you're hiring for?