# ๐ฅ Insurance Cost Prediction using Machine Learning
## ๐ Project Overview
This project predicts medical insurance charges based on personal and lifestyle attributes such as age, BMI, smoking habits, number of children, and region.
The project uses **Linear Regression** and **Lasso Regression** to analyze how different features impact insurance costs and to handle feature selection using regularization.
---
## ๐ Dataset
**File:** `insurance.csv`
### Columns Description
| Column | Description |
|----------|------------|
| age | Age of the insured person |
| sex | Gender (male / female) |
| bmi | Body Mass Index |
| children | Number of dependents |
| smoker | Smoking status (yes / no) |
| region | Residential area |
| charges | Medical insurance cost (target variable) |
---
## โ๏ธ Technologies Used
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-learn
---
## ๐ง Machine Learning Workflow
1. Load the dataset
2. Perform Exploratory Data Analysis (EDA)
3. Convert categorical variables using `pd.get_dummies()`
4. Split data into training and testing sets
5. Train models using:
- Linear Regression
- Lasso Regression
6. Evaluate model performance
7. Visualize predictions
---
## ๐ How to Run the Project
1. Clone the repository:
```bash
git clone
github.com
```
2. Navigate to the project directory
3. Install required dependencies:
pip install pandas numpy matplotlib seaborn scikit-learn
4. Launch Jupyter Notebook
5. Open the notebook and run all cells
---
## ๐ Model Evaluation
- The models are evaluated using:
- Mean Squared Error (MSE)
- Rยฒ Score
- Lasso Regression helps reduce overfitting by shrinking less important feature coefficients to zero.
---
## ๐ฎ Future Improvements
- Hyperparameter tuning for Lasso (alpha)
- Try Ridge and ElasticNet Regression
- Feature scaling
- Deploy using Flask or Streamlit