Skip to content

CodeSyedX/Insurance_Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Insurance Cost Prediction Model

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.

Features

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.

Dataset & Features

The model is trained on insurance.csv, which includes:

  • age: Age of the person
  • bmi: Body Mass Index
  • children: Number of children
  • sex: 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)

Installation

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.txt

Training the Model

If you need to retrain the model, run:

python train_model.py

This will train the LinearRegression model and save it as insurance_model.pkl.

Running the Web App

Start the Flask app:

python app.py

Visit http://127.0.0.1:5000/ in your browser.

Deployment Guide

1. Deploy Locally

Ensure Flask is installed and run:

python app.py

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages