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.
The dataset (insurance.csv) contains the following columns:
age→ Age of the individualsex→ Gender (male/female)bmi→ Body Mass Indexchildren→ Number of childrensmoker→ Smoking status (yes/no)region→ Residential region (northeast,northwest,southeast,southwest)charges→ Medical insurance cost (Target variable)
- Python 3.12+
- Flask
- Pandas
- NumPy
- Scikit-learn
- HTML/CSS (for the frontend)
✅ 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
Clone the repository:
git clone https://github.com/pythonicshariful/insurance-charge-predictor.git
cd insurance-charge-predictorCreate and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Linux/Mac
venv\Scripts\activate # On WindowsInstall dependencies:
pip install -r requirements.txtRun the Flask app:
python app.pyOpen your browser and go to:
http://127.0.0.1:5000
Enter details like Age, BMI, Smoker, etc. → Get predicted charges 🎉
- Algorithm used:
RandomForestRegressor(or whichever you used) - Evaluation metrics: RMSE, R² Score
#machine-learning #flask #insurance #regression #python #scikit-learn #ml-app
This project is licensed under the MIT License.
👨💻 Author: Shariful Islam
🚀 Happy Coding!

