Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 Vehicle Insurance Cross-Sell Propensity Prediction

Predicting and ranking customers by their likelihood of purchasing vehicle insurance using Machine Learning

An end-to-end machine learning project built on 380K+ customer records to help an insurance company prioritize customers for vehicle insurance cross-selling.


📌 Business Problem

An insurance company that already sells health insurance wants to cross-sell vehicle insurance to its existing customers.

Calling all 380,000+ customers is inefficient — every call costs time and money, while most customers are not interested.

Objective: Build a machine learning model that ranks customers by their likelihood of purchasing vehicle insurance, allowing the call center to prioritize high-propensity customers.

The project covers:

EDA → Preprocessing → Class Imbalance Handling → Model Training → Model Comparison → Explainability → Business Recommendations


📊 Dataset

Health Insurance Cross Sell Prediction — Analytics Vidhya JantaHack dataset hosted on Kaggle with approximately 381,000 customer records.

🔗 View Dataset on Kaggle

The target variable is Response:

  • 0 — Customer is not interested
  • 1 — Customer is interested

Class Imbalance

The dataset has a severe class imbalance of approximately:

  • 88% — Not Interested (Response = 0)
  • 12% — Interested (Response = 1)

Because of this imbalance, model evaluation focuses on Precision, Recall, F1-score, and ROC-AUC, rather than accuracy alone.


🔍 Key EDA Findings

  • Customers with a history of vehicle damage showed substantially higher response rates.
  • Customers who were previously insured for a vehicle were much less likely to respond positively.
  • Customers with older vehicles showed higher purchase propensity.
  • Annual_Premium and Vintage showed relatively limited separation between buyers and non-buyers.
  • Vehicle damage history and previous insurance status emerged as particularly important predictors.

⚙️ Machine Learning Workflow

1. Exploratory Data Analysis

  • Target class distribution analysis
  • Customer response analysis
  • Feature distribution analysis
  • Correlation analysis
  • Automated profiling using YData Profiling

2. Data Preprocessing

  • Binary categorical encoding
  • One-hot encoding for Vehicle_Age
  • Target encoding for high-cardinality features:
    • Region_Code
    • Policy_Sales_Channel
  • Stratified train-validation split
  • Feature scaling where required

3. Class Imbalance Handling

Two approaches were compared:

  • Class weighting
  • SMOTE (Synthetic Minority Oversampling Technique)

For XGBoost without SMOTE, class imbalance was handled using:

scale_pos_weight = number of negative samples / number of positive samples

SMOTE was applied only to the training data to avoid contaminating the validation set.

4. Model Development

Three machine learning algorithms were evaluated:

  1. Logistic Regression
  2. Random Forest
  3. XGBoost

Both weighted and SMOTE-based approaches were compared, resulting in six model variants.

5. Model Explainability

Model interpretation was performed using:

  • XGBoost Feature Importance
  • SHAP (SHapley Additive exPlanations)

🏆 Model Performance

Model Accuracy Precision Recall F1 ROC-AUC
XGBoost 0.7125 0.2878 0.9123 0.4376 0.8565
Random Forest 0.7024 0.2828 0.9295 0.4336 0.8560
Logistic Regression 0.7359 0.2995 0.8624 0.4446 0.8462
Logistic Regression (SMOTE) 0.7520 0.3095 0.8312 0.4511 0.8461
Random Forest (SMOTE) 0.7507 0.3084 0.8323 0.4500 0.8438
XGBoost (SMOTE) 0.6486 0.2489 0.9257 0.3924 0.8224

🥇 Selected Model: XGBoost

ROC-AUC: 0.8565

XGBoost without SMOTE achieved the highest ROC-AUC and was selected as the final model.

Class imbalance was handled using scale_pos_weight, calculated from the class distribution of the training data.

Although Logistic Regression with SMOTE achieved the highest F1-score, ROC-AUC was prioritized because the primary business objective is customer propensity ranking rather than only binary classification at a fixed threshold.

The model's predicted probabilities can therefore be used to rank customers according to their likelihood of purchasing vehicle insurance.


🔎 Model Explainability

XGBoost Feature Importance and SHAP were used to understand the factors influencing model predictions.

The analysis identified:

  • Previously_Insured
  • Vehicle_Damage

as the two most influential predictors in the XGBoost model.

SHAP analysis was used to examine both feature importance and the direction in which feature values influence individual model predictions.


💼 Business Recommendation

Instead of using the model only as a simple Yes/No classifier, the predicted probabilities can be treated as customer propensity scores.

Customers can be ranked from:

Highest Purchase Probability → Lowest Purchase Probability

The call center can then prioritize customers according to available campaign capacity and budget.

This approach can help:

  • Reduce unnecessary outbound calls
  • Prioritize higher-propensity customers
  • Improve utilization of call-center resources
  • Reduce time spent contacting unlikely buyers
  • Potentially increase conversions at the same call volume

🛠️ Tech Stack

  • Python
  • Pandas
  • NumPy
  • Scikit-learn
  • XGBoost
  • Imbalanced-learn (SMOTE)
  • SHAP
  • YData Profiling
  • Matplotlib
  • Seaborn
  • Jupyter Notebook

📁 Repository Structure

crosssell-propensity-ml/
│
├── outputs/
│   ├── README.md
│   └── Sample_Submission.csv
│
├── reports/
│   ├── Eda_Profile_Report.html
│   ├── README.md
│   └── vehicle_insurance_propensity_report.docx
│
├── .gitignore
├── README.md
├── Vehicle_Insurance_Propensity_Modeling.ipynb
└── requirements.txt

🚀 Future Improvements

  • Hyperparameter optimization
  • Business cost-based threshold optimization
  • Precision@K and Recall@K evaluation
  • Lift and cumulative gains analysis
  • Probability calibration
  • Model drift monitoring
  • Periodic retraining using new campaign response data

👤 Author

Prakhar Gupta
M.Sc. Statistics & Computing, BHU
Data Analytics & Machine Learning Enthusiast

🔗 LinkedIn
🔗 GitHub

About

Machine learning project to predict customer propensity for vehicle insurance cross-selling using Logistic Regression, Random Forest, and XGBoost, with class imbalance handling and model evaluation.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages