| --- |
| title: Medical Insurance Cost Prediction |
| emoji: π₯ |
| colorFrom: blue |
| colorTo: green |
| sdk: streamlit |
| sdk_version: 5.0.0 |
| app_file: app.py |
| pinned: false |
| license: mit |
| short_description: A regression model predicting medical insurance charges based on demographic and health metrics. |
| --- |
| |
| # Medical Insurance Cost Prediction Using Machine Learning π₯β¨ |
|
|
| Welcome! This repository marks my **second (2nd)** hands-on Machine Learning project developed completely by myself. |
|
|
| Moving forward from classification, this project focuses on a **Regression** task. I built a predictive model that estimates the medical insurance charges (`charges`) billed to an individual based on their demographic and health metrics. |
|
|
| --- |
|
|
| ## π Dataset Overview |
|
|
| The dataset used is `insurance.csv`, which consists of the following features: |
|
|
| - **age:** Age of the primary beneficiary. |
| - **sex:** Insurance contractor gender (female, male). |
| - **bmi:** Body Mass Index, providing an understanding of body weight relative to height. |
| - **children:** Number of children covered by health insurance / Number of dependents. |
| - **smoker:** Smoking status of the beneficiary (yes, no). |
| - **region:** The beneficiary's residential area in the US (northeast, southeast, southwest, northwest). |
| - **charges (Target Variable):** Individual medical costs billed by health insurance. |
|
|
| --- |
|
|
| ## π οΈ Tech Stack Used |
|
|
| - **Programming Language:** Python π |
| - **Environment:** VS Code & Jupyter Notebook (`insurance.ipynb`) |
| - **Libraries:** Pandas, NumPy, Scikit-Learn |
| - **Deployment:** Hugging Face Spaces & Gradio |
|
|
| --- |
|
|
| ## π Project Objective & Learning Curve |
|
|
| The goal of this project was to tackle continuous numerical data and learn how lifestyle choices (like smoking status) and physical attributes (like BMI) impact insurance costs. |
|
|
| Through this project, I practiced: |
|
|
| 1. Handling categorical text data using One-Hot Encoding / Label Encoding. |
| 2. Implementing Regression algorithms (like Linear Regression, Decision Tree Regressor, or Random Forest). |
| 3. Evaluating model performance using metrics like R-squared ($R^2$) and Root Mean Squared Error (RMSE). |
|
|
| This is another confident step forward in my Data Science journey! |
|
|
| --- |
|
|
| ## π How to Run Locally |
|
|
| ### 1. Clone and Enter the Repository |
|
|
| ```bash |
| git clone [https://huggingface.co/amirsoahil101/Medical_Insurance_Cost_Prediction_Using_Machine_Learningt](https://huggingface.co/amirsoahil101/Medical_Insurance_Cost_Prediction_Using_Machine_Learning) |
| cd Insurance-Cost-Prediction-Using-Machine-Learning |
| ``` |
|
|