Skip to content

This project predicts medical insurance charges based on personal details such as age, gender, BMI, number of children, smoking habits, and region. It uses a Machine Learning model trained on the insurance.csv dataset and provides a Flask web app interface for user input

Notifications You must be signed in to change notification settings

pythonicshariful/insurance-charge-predictor

Repository files navigation

🏥 Insurance Charges Prediction App

This project predicts medical insurance charges based on personal details such as age, gender, BMI, number of children, smoking habits, and region.
It uses a Machine Learning model trained on the insurance.csv dataset and provides a Flask web app interface for user input.


📂 Dataset

The dataset (insurance.csv) contains the following columns:

  • age → Age of the individual
  • sex → Gender (male / female)
  • bmi → Body Mass Index
  • children → Number of children
  • smoker → Smoking status (yes / no)
  • region → Residential region (northeast, northwest, southeast, southwest)
  • charges → Medical insurance cost (Target variable)

⚙️ Tech Stack

  • Python 3.12+
  • Flask
  • Pandas
  • NumPy
  • Scikit-learn
  • HTML/CSS (for the frontend)

🚀 Features

✅ Train a regression model on insurance.csv
✅ Flask app takes user input (Age, BMI, Children, Smoker, Region, etc.)
✅ Predicts expected insurance charges
✅ Simple web UI


📦 Installation

Clone the repository:

git clone https://github.com/pythonicshariful/insurance-charge-predictor.git
cd insurance-charge-predictor

Create and activate a virtual environment:

python -m venv venv
source venv/bin/activate   # On Linux/Mac
venv\Scripts\activate      # On Windows

Install dependencies:

pip install -r requirements.txt

▶️ Usage

Run the Flask app:

python app.py

Open your browser and go to:

http://127.0.0.1:5000

Enter details like Age, BMI, Smoker, etc. → Get predicted charges 🎉


📸 Example UI

App Screenshot

🎥 Tutorial Video

Watch the tutorial


📊 Model Performance

  • Algorithm used: RandomForestRegressor (or whichever you used)
  • Evaluation metrics: RMSE, R² Score

🏷️ Tags

#machine-learning #flask #insurance #regression #python #scikit-learn #ml-app


📜 License

This project is licensed under the MIT License.


👨‍💻 Author: Shariful Islam
🚀 Happy Coding!

About

This project predicts medical insurance charges based on personal details such as age, gender, BMI, number of children, smoking habits, and region. It uses a Machine Learning model trained on the insurance.csv dataset and provides a Flask web app interface for user input

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published