This project predicts healthcare insurance premiums using machine learning models trained on past customer data. The goal is to help users estimate their insurance premium based on their information, making the process transparent and accessible.
- Purpose: Predict the insurance premium for a customer using their details (such as age, health, etc.).
- Approach: The project uses past years' customer data and their premiums to train machine learning models. The trained models are then used to predict premiums for new customers.
To improve accuracy, the project uses two separate models based on the customer's age:
-
Age ≤ 25 years:
- Model: Linear Regression
- Accuracy: ~98.80% (with only 2.14% extreme error rate)
- Reason: This model performs extremely well for younger customers.
-
Age > 25 years:
- Model: XGBoost Regression
- Accuracy: ~99.7% (with only 0.32% extreme error rate)
- Reason: XGBoost gives better results for older customers compared to Linear Regression.
main.py
: Main application file to run the prediction app.prediction_helper.py
: Helper functions for prediction logic.artifacts/
: Contains trained model and scaler files.notebook/
: Contains datasets and Jupyter notebooks for data analysis and model training.requirements.txt
: List of all required Python packages.
Before running the application, install the required dependencies using the following command:
pip install -r requirements.txt
To start the application, run the following command in your terminal:
python main.py
This will launch the Streamlit web interface where you can input customer details and get a premium prediction.
- Predicts insurance premium based on user input.
- Uses two different models for better accuracy based on age group.
- User-friendly web interface built with Streamlit.
- All model files are stored in the
artifacts
folder. - Datasets and notebooks for model training are in the
notebook
folder (located in the same directory asartifacts
). - Make sure you have Python installed on your system.
- Open a terminal in the project directory.
- Install dependencies:
pip install -r requirements.txt
- Run the app:
python main.py
- Enter customer details in the web interface to get a premium prediction.
For any questions or support, please contact the project maintainer.