This project predicts insurance costs based on user inputs like age, BMI, number of children, smoking status, gender, and region. It uses Linear Regression to estimate medical insurance charges.
✅ Machine Learning Model: Trained on insurance dataset using LinearRegression from sklearn.
✅ Web Interface: Users can input details via a Flask-based web app.
✅ Interactive UI: Bootstrap-powered form for a professional look.
✅ Model Deployment: Deployed locally using Flask.
The model is trained on insurance.csv, which includes:
age: Age of the personbmi: Body Mass Indexchildren: Number of childrensex: Male (0) or Female (1)smoker: No (0) or Yes (1)region: Encoded as 0 (Northwest), 1 (Southeast), 2 (Southwest)charges: Insurance cost (target variable)
Clone the repository and install the required dependencies:
git clone https://github.com/your-repo/insurance-prediction.git
cd insurance-prediction
pip install -r requirements.txtIf you need to retrain the model, run:
python train_model.pyThis will train the LinearRegression model and save it as insurance_model.pkl.
Start the Flask app:
python app.pyVisit http://127.0.0.1:5000/ in your browser.
Ensure Flask is installed and run:
python app.py