Health Insurance Claims Analysis with Python and Jupyter Notebook, analyzing demographic and behavioural risk factors (Age, BMI, Smoking status) impacting medical insurance charges.
- Overview
- Dataset
- Technologies Used
- Installation
- Usage
- Analysis & Visualizations
- Conclusion
- Credits
- License
- The dataset was chosen to assess heath insurance underwriting.
- Python in Jupyter Notebook was used for the analysis.
- The objective was to determine segmentation, risk scoring, data insights and scenario testing
- The dataset is Medical Cost Personal Datasets from Kaggle
- Size of the dataset is 1338 rows and 7 columns
- The analysis with this dataset is duplicated in Power PI and Tableau Desktop
Dataset: insurance.csv
- Languages & Libraries: Python, Pandas, NumPy, Matplotlib, Seaborn, sklearn
- Tools: Jupyter Notebook, VS Code, Git, GitHub
Step-by-step instructions to set up the project locally:
# Clone the repository
git clone git clone https://github.com/Kurodataio/Health-Insurance-Claims.git
# Navigate to the project folder
cd Health-Insurance-Claims
# Launch Jupyter Notebook
jupyter notebook
Instructions for using the project:
- Open the main notebook (
health-insurance-claims.ipynb) - Run ALL cells or each cell sequentially to reproduce the analysis
- Visualizations and results will be generated automatically
-
Age vs. Claims Cost (Smoker Highlighted)
- 3 clear bands with linear relationship between age and claims cost
- Bottom blue non-smokers band has lowest age to claims cost
- Middle non-smokers and smokers
- Top orange smokers band has the gighest agr to claims cost
- The is a clear positive linear relationship between age and claims cost
- Smoking increases the cost of caims
-
BMI vs. Claims Cost
-
Claims Cost by Smoker Status
- The average claims cost between smokers and non-smokers claims cost is significant
- Non-smokers have a median cost of $7,500
- Smokers have a mediam cost of $34,500
- There is no overlap between the smoking and non-smoking groups
- The 75th percentile for non-snokers is lower than the 25th percentile for smokers
- For non smokers the claims cost are between $4,000 and $11,500
- For smokers the claims cost are between $21,000 to $41,000
- Smokers have a wider range (variance) of claims costs
- Non smokers have many outlying claims around $23,000 up to $37,000
- This plot shows high outliers for non-smokers are within the typical claims cost for smokers

-
Feature_Importance
-
Claims Cost by Dependents
- The average (median) claims cost for all groups is $8,000 and $11,000
- 0 to 2 dependents: The median is around $8,500–$9,500
- 3 to 4 dependents: The mdian peaks at $11,000 for 4 dependents
- 5 dependents: The median is under $9,000
- The group with 0 dependents has outliers with the highest cost of $60,000+
- The group with 5 dependents has outliers with the lowest cost at under $20,000
- The number of dependents does not dictate high claims cost. In fact it seems the opposite.

-
Claims Cost by Gender
-
Claims Cost by Region
- Southwest, Southeast, Northwest have a median claims cost around $9k to $9.3k
- Northeast has a higher median claims cost around $10k.
- Region is a not a significant determinant of claims cost.
- The Southeast has the highest range of claims costs. It also has the highest outlier costs
- The outliers can be associated with risk factors such as smoking and high BMI

-
Average BMI by Region
- Highest BMI Region: southeast (Mean: 33.36)
-
Percentage of Smokers by Region
- Highest Smoker Region: southeast (25.0%)
-
The plot of Average BMI and smokers confirms why the Southeast has the higher claims costs

-
Claims Cost Distribution by Smoking Status
- The non-smokers show right-skewed distribution
- The highest frequency (density) of individuals show claims cost between $2,000 and $10,000.
- The data shows that most of the minor claims are by non-smokers
- The data shows two peaks for smokers. It is bimodal.
- The first peak cluster is between $15,000–$25,000.
- The second peak cluster is between $35,000–$50,000.

-
Correlation_Heatmap
- The positive correlation between smoker and claims cost is 0.79
- The positive correlation between age and claims cost is 0.30 and 0.20 for bmi and claims cost.
- The heatmap does not show the interaction effect between BMI and smoking which is associated with higgher costs.
- The heatmap clearly shows the following:
-
Distribution of Claims Cost
- The distribution of claims is skewed to the right (positive) skewed
- Most of the insurance claims are low to medium in costs
- The distribution is bimodal, primary and secondary peaks
- The two peaks suggest sub populations of claims cost
- Mode Claims Cost is $1639.56
- Median Claims Cost is $9382.03
- Mean Claims Cost is $13270.42

-
Loss_Ratio_Distribution
- The Loss Ratio (LR) represents the ratio of losses (claims paid) to premiums earned
- Loss Ratio (LR) = Total Losses (L) / Total Premium (P)
- A loss ratio of 1.0 (or 100%) means the company is paying out exactly what it collects in premiums.
- Most of the small and medium claims are profitable.
- The high claims costs are not profitable
- Adjusting the slope coefficient to cover higher costs penalizes the lower claims with higher premiums

-
Loss Ratio Distribution: Current vs Proposed Pricing
- Smoking is the biggest risk feature for high claims cost. This single driver puts an individual into a higher cost bracket regardless of age or BMI.
- Obesity (BMI
$\ge$ 30) acts as a compounding multiplier when associated with smoking. - Smoking and BMI combined are associated with the highest claims cost
- The Southeast region has the highest levels of smoking and obesity (high BMI) rates. Remediation could be targeted at this region as a priority.
- The southeast region has the highest claims cost, which is associated with the highest number of smokers and obese people.
- Further data and analysis is required to validated the surge in claims cost associated with smoking and BMI.
- What are the actual illnesses associated with high BMI and smoking?
- Are medical protocols and procedures initiated based on BMI and smoking signals or the actual presence of disease?
- Dataset Source: Kaggle → Datasets
- Google Gemini Link
- CoPilot Link
This project is licensed under the MIT License




