Skip to content

MatthieuLeNozach/insurance_classification_imalanced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Insurance cross-selling potential prediction:

Working on a dataset with imbalanced target classes

Libraries

  • Tabular

    • pandas
    • numpy
  • Tools

    • joblib: persistence
  • Visualization

    • plotly express / graphing objects
    • ipywidgets: subplot container
  • Machine Learning

    • scikit-learn: pipeline, models
    • imbalanced-learn: resampling
    • feature-engine: transformers
  • API

    • flask

Structure

.
├── app : API 
│   └── templates: html structure of the form page
├── bin: dataset downloader (requires Kaggle API key)
├── data: train / test + answer
├── models: ml models and pipelines
├── notebooks: exploration, evaluation
├── output: plots
├── src: pipeline builder, viz functions, etc
└── tests: api, result matches local / distant models

API

Run locally

export FLASK_APP=app/app.py

flask run -h 0.0.0.0 -p 5000

API call example

curl -X POST \
  -d "Gender=male" \
  -d "Vehicle_Damage=yes" \
  -d "Vehicle_Age=<1 Year" \
  -d "Region_Code=28" \
  -d "Policy_Sales_Channel=124" \
  -d "Annual_Premium=30000" \
  -d "Age=25" \
  -d "Previously_Insured=0" \
  http://localhost:5000/predict

UI app

http://127.0.0.1:5000/predict

Web form

Viz

QQ Plots

binary feats

target

num_f

num_f

corr

cont

About

Binary classification from a dataset with imbalanced target feature classes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages