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.
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
Health Insurance Cross Sell Prediction — Analytics Vidhya JantaHack dataset hosted on Kaggle with approximately 381,000 customer records.
The target variable is Response:
0— Customer is not interested1— Customer is interested
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.
- 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_PremiumandVintageshowed relatively limited separation between buyers and non-buyers.- Vehicle damage history and previous insurance status emerged as particularly important predictors.
- Target class distribution analysis
- Customer response analysis
- Feature distribution analysis
- Correlation analysis
- Automated profiling using YData Profiling
- Binary categorical encoding
- One-hot encoding for
Vehicle_Age - Target encoding for high-cardinality features:
Region_CodePolicy_Sales_Channel
- Stratified train-validation split
- Feature scaling where required
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.
Three machine learning algorithms were evaluated:
- Logistic Regression
- Random Forest
- XGBoost
Both weighted and SMOTE-based approaches were compared, resulting in six model variants.
Model interpretation was performed using:
- XGBoost Feature Importance
- SHAP (SHapley Additive exPlanations)
| 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 |
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.
XGBoost Feature Importance and SHAP were used to understand the factors influencing model predictions.
The analysis identified:
Previously_InsuredVehicle_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.
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
- Python
- Pandas
- NumPy
- Scikit-learn
- XGBoost
- Imbalanced-learn (SMOTE)
- SHAP
- YData Profiling
- Matplotlib
- Seaborn
- Jupyter Notebook
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
- 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
Prakhar Gupta
M.Sc. Statistics & Computing, BHU
Data Analytics & Machine Learning Enthusiast