Medical Expenses Prediction

Medical Expenses Prediction Using Multiple Linear Regression

Developed a machine learning model to predict medical insurance expenses through data preprocessing, exploratory data analysis (EDA), feature analysis, and model evaluation.

The Objective

What factors influence individual medical expenses, and how well can a multiple linear regression model predict those expenses? This project explores the statistical relationships between patient demographics, lifestyle choices (such as smoking), and resulting insurance charges.

Data Stack

  • Python (Core Language)
  • Pandas (Data Manipulation & Encoding)
  • Seaborn / Matplotlib (EDA Visualization)
  • Scikit-Learn (Model Training & Metrics)

Exploratory Data Analysis (EDA)

EDA Visualization 1

Visualizing feature distributions and correlations to identify key cost drivers using Seaborn.

Model Training & Evaluation

Model Evaluation Flow 1

Categorical variables (smoker, region, sex) were preprocessed using Pandas categorical encoding. The dataset was split into an 80/20 training and testing ratio. A Multiple Linear Regression model was fit to the training data, utilizing Scikit-Learn to evaluate predictive performance by plotting actual vs. predicted expenses and calculating the R-squared (R²) metrics.

Algorithm

Multiple LinReg

Train R² Score

0.74

Test R² Score

0.80

Test Split Ratio

20%