Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated codebase #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,930 changes: 3,930 additions & 0 deletions .ipynb_checkpoints/Medical Cost Insurance-checkpoint.ipynb

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions .ipynb_checkpoints/README-checkpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<h1 align="center">Medical Insurance Cost Prediction</h1>

<div align= "center">
<h4>Medical Insurance Cost Prediction using Random Forest Regressor.</h4><br>
<img src="https://github.com/SahilChachra/Medical-Cost-Prediction/blob/master/sampleImages/doc.gif">
</div>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

## :innocent: Motivation

To predict things have been never so easy. I used to wonder how Insurance amount is charged normally. So, in the mean time I came across this dataset and thought of working on it! Using this I wanted to know how few features determine our insurance amount!

## :hourglass: Some Screenshots

![](https://github.com/SahilChachra/Medical-Cost-Prediction/blob/master/sampleImages/Cor.png)

![](https://github.com/SahilChachra/Medical-Cost-Prediction/blob/master/sampleImages/AgevsCharges.png)

![](https://github.com/SahilChachra/Medical-Cost-Prediction/blob/master/sampleImages/deployments.png)

## :star: Features
<ol>
<li>Exploring the dataset</li>
<li>Converting Categorical values to Numerical</li>
<li>Plotting Heatmap to see dependency of Dependent valeu on Independent features</li>
<li>Data Visualization (Plots of feature vs feature)</li>
<li>Plotting Skew and Kurtosis</li>
<li>Data Preparation</li>
<li>Prediction using Linear Regression</li>
<li>Prediction using SVR</li>
<li>Prediction using Ridge Regressor</li>
<li>Prediction using Random Forest Regressor</li>
<li>Performing Hyper tuning for above mentioned models</li>
<li>Plotting Graph for all Models to compare performance</li>
<li>Preparing model for deployment</li>
<li>Deployed model using Flask</li>
</ol>

## :key: Results

#### Model gave 86% accuracy for Medical Insurance Amount Prediction using <code>Random Forest Regressor</code>


## :file_folder: Dataset
The dataset used can be downloaded here (Kaggle) - [Click to Download](https://www.kaggle.com/mirichoi0218/insurance)

## :heart: Owner
Made with :heart:&nbsp; by [Sahil Chachra](https://github.com/SahilChachra)

## :eyes: License
MIT © [Sahil Chachra](https://github.com/SahilChachra/Medical-Cost-Prediction/blob/master/LICENSE)
2,458 changes: 2,281 additions & 177 deletions Medical Cost Insurance.ipynb

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ To predict things have been never so easy. I used to wonder how Insurance amount

#### Model gave 86% accuracy for Medical Insurance Amount Prediction using <code>Random Forest Regressor</code>

## How to run?
<ol>
<li>Clone the repository</li>
<li>Check Python3 version (by typing python3 in terminal) and if required update it to 3.12</li>
<li>Install dependenceis - pip3 install -r requirements.txt</li>
<li>Download the insurance.csv file if not present in the folder by default. (Kaggle link below)</li>
<li>Now, open Medical Cost Prediction notebook and work on your model</li>
<li>In the end the model will be saved with the name - "rf_tuned.pkl"</li>
<li>Now, after trainig you model, simple run - python3 app.py to load Web app</li>

</ol>

## :file_folder: Dataset
The dataset used can be downloaded here (Kaggle) - [Click to Download](https://www.kaggle.com/mirichoi0218/insurance)
Expand Down
44 changes: 7 additions & 37 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
backcall==0.1.0
certifi==2019.11.28
Click==7.0
colorama==0.4.3
cycler==0.10.0
decorator==4.4.1
Flask==1.1.1
Flask-Cors==3.0.9
graphviz==0.13.2
ipython>=7.16.3
ipython-genutils==0.2.0
itsdangerous==1.1.0
jedi==0.15.2
Jinja2==2.11.3
joblib==0.14.1
kiwisolver==1.1.0
MarkupSafe==1.1.1
matplotlib==3.1.2
numpy==1.22.0
pandas==0.25.3
parso==0.5.2
pickleshare==0.7.5
prompt-toolkit==3.0.2
pydotplus==2.0.2
Pygments==2.7.4
pyparsing==2.4.6
python-dateutil==2.8.1
pytz==2019.3
scikit-learn==0.22
scipy==1.4.1
six==1.13.0
sklearn==0.0
traitlets==4.3.3
wcwidth==0.1.8
Werkzeug==0.16.0
wincertstore==0.2
gunicorn==20.0.4
flask
numpy
pandas
matplotlib
seaborn
scikit-learn
xgboost
Binary file modified rf_tuned.pkl
Binary file not shown.
Binary file modified sampleImages/AgevsCharges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sampleImages/Cor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.