01 / ContextThe question
behind the work.
Fraud is an imbalanced classification problem where accuracy can look acceptable even when the model misses nearly every fraudulent claim.
My role
I built the complete modeling workflow: cleaning, preprocessing, train-test evaluation, three model families, fraud-class metrics, SHAP interpretation, saved models, and scoring scripts.
03 / In detailA reusable modeling pipeline
The project starts with 1,000 insurance claims and 39 policy, claim, demographic, and vehicle features. I mapped the fraud target, split numeric and categorical inputs, applied median and most-frequent imputation, and used a scikit-learn ColumnTransformer so every model used the same preprocessing path.
Each candidate model lives inside a pipeline with its preprocessing, training, evaluation, and serialization steps. That made the comparison repeatable and left behind saved models and scoring scripts instead of a one-time notebook result.
Comparing the real tradeoff
I compared logistic regression, random forest, and XGBoost on ROC-AUC, fraud precision, fraud recall, accuracy, confusion matrices, and ROC curves. The baseline logistic model reached 0.61 AUC and detected no fraud at the default threshold.
Random Forest reached 0.86 AUC and XGBoost reached 0.83. XGBoost produced the more useful screening balance in this run, with 0.62 fraud precision, 0.51 fraud recall, and 0.81 accuracy.
Making the score inspectable
I added SHAP analysis to show how the XGBoost model was separating high- and low-risk claims. Major-damage and total-loss indicators carried strong positive influence, while policy, vehicle, and customer signals added context to the prediction.
The result is an end-to-end fraud-screening workflow that pairs model performance with feature-level explanation, reusable model artifacts, and a clear path from raw claim fields to a risk score.