This project analyzes medical insurance costs using Python and applies a Linear Regression model to understand the key factors that influence healthcare expenses.
The project covers the complete data analysis workflow, including data exploration, data cleaning, exploratory data analysis (EDA), feature encoding, model development, and model evaluation.
The objective of this project is to identify the major factors that influence medical insurance charges and evaluate the performance of a Linear Regression model.
Source: Kaggle
The dataset contains 1,338 records and 7 features, including:
- Age
- Sex
- BMI (Body Mass Index)
- Number of Children
- Smoker Status
- Region
- Medical Charges (Target Variable)
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-learn
- Jupyter Notebook
- Imported the dataset into Jupyter Notebook.
- Examined the dataset structure.
- Reviewed data types.
- Checked dataset dimensions.
- Generated descriptive statistics.
- Checked for missing values.
- Encoded categorical variables.
- Prepared the dataset for machine learning.
- Explored relationships between variables.
- Visualized important patterns using charts.
- Split the dataset into training and testing sets.
- Built a Linear Regression model.
The model performance was evaluated using:
- R² Score
- Mean Absolute Error (MAE)
- Mean Squared Error (MSE)
- Root Mean Squared Error (RMSE)
- Smoking status is one of the strongest predictors of medical insurance charges.
- Age and BMI also have a significant impact on healthcare costs.
- The Linear Regression model explains a large proportion of the variation in medical charges using the selected features.
- Medical Cost Analysis & Linear Regression Using Python.ipynb
- Medical Cost Analysis & Linear Regression Using Python.pdf
- health.csv
- Medical-Cost-Analysis.png
- Compare Linear Regression with other machine learning algorithms.
- Perform feature engineering.
- Improve model performance through hyperparameter tuning.
- Build an interactive dashboard for data visualization.
Abdulmalik Ibrahim Ozovehe
Founder, AIM Analytics
Website: https://aimanalytics.carrd.co
LinkedIn: https://www.linkedin.com/in/aimanalytics
