mirzayasirabdullahbaig07/Insurance-Claim-Prediction
소개
Train in Google Colab → deploy a live "Claim Compass" app on Streamlit Community Cloud. This predicts a continuous claim amount (regression), not a yes/no classification.
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- -1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalInsurance Claim Amount Prediction — Deployable Project
Train in Google Colab → deploy a live "Claim Compass" app on Streamlit Community Cloud. This predicts a continuous claim amount (regression), not a yes/no classification.
Files
| File | Purpose | Push to GitHub? |
|---|---|---|
app.py |
Streamlit app — single & batch claim estimates, full custom UI | ✅ Yes |
requirements.txt |
Python dependencies | ✅ Yes |
.streamlit/config.toml |
Theme colors (deep navy + sky-blue accent) | ✅ Yes — keep the .streamlit folder name exactly |
claim_model.pkl |
Trained, tuned Random Forest regressor | ✅ Yes |
gender_encoder.pkl, diabetic_encoder.pkl, smoker_encoder.pkl, region_encoder.pkl |
Fitted LabelEncoders for each categorical column |
✅ Yes |
feature_columns.pkl |
Exact column order the model expects | ✅ Yes |
Insurance_Claim_Prediction_Colab.ipynb |
Training notebook | Optional — nice to keep for reference |
insurance.csv |
Raw dataset | ❌ No — not needed at inference time |
Step 1 — Train the model in Colab
- Open
Insurance_Claim_Prediction_Colab.ipynbin Google Colab. - Run all cells top to bottom.
- Upload
insurance.csvwhen prompted. - At the end, 6 files auto-download:
claim_model.pklgender_encoder.pkldiabetic_encoder.pklsmoker_encoder.pklregion_encoder.pklfeature_columns.pkl
Step 2 — Arrange your project folder
claim-app/
├── app.py
├── requirements.txt
├── .streamlit/
│ └── config.toml
├── claim_model.pkl
├── gender_encoder.pkl
├── diabetic_encoder.pkl
├── smoker_encoder.pkl
├── region_encoder.pkl
└── feature_columns.pkl
Step 3 — Test locally
cd claim-app
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
streamlit run app.py
Opens at http://localhost:8501.
Step 4 — Push to GitHub
git init
git add app.py requirements.txt .streamlit *.pkl
git commit -m "Insurance claim prediction app"
git branch -M main
git remote add origin https://github.com/<your-username>/<your-repo>.git
git push -u origin main
Step 5 — Deploy on Streamlit Community Cloud
- Go to share.streamlit.io and sign in with GitHub.
- Click New app.
- Select your repo, branch
main, main fileapp.py. - Click Deploy.
You'll get a public URL like https://<your-app>.streamlit.app.
About the dataset
insurance.csv has columns: Id, age, gender, bmi, bloodpressure, diabetic, children, smoker, region, claim. The target is claim (a dollar amount),
so this is trained as a regression problem — the notebook compares
Linear Regression, Random Forest, and Gradient Boosting, then tunes the
best one with GridSearchCV before saving it.
Note: your original notebook's code (
Code.ipynb) was written for a different dataset (train_SJC.csv, with columns likeClaimNumber,WeeklyWages,UltimateIncurredClaimCost). Since that file wasn't the one you uploaded, this notebook was rebuilt from scratch to match the actualinsurance.csvschema you provided.
관련 프로젝트 살펴보기
불러오는 중…