h2oai / wave-apps

Sample AI Apps built with H2O Wave.
MIT License
144 stars 51 forks source link

Initial commit for home insurance churn app #53

Closed g-eoj closed 3 years ago

g-eoj commented 3 years ago

Conversion of Telco Churn app to use a home insurance dataset.

Data source https://www.kaggle.com/ycanario/home-insurance

Data pre-processing:

import h2o

h2o.init()

df = h2o.import_file('./home_insurance.csv.zip')

df['P1_DOB'] = df['P1_DOB'].as_date('%d/%m/%Y')
df['YEARBUILT'] = df['YEARBUILT'].ascharacter().as_date('%Y')
df['MTA_DATE'] = df['MTA_DATE'].as_date('%d/%m/%Y')
df['churn'] = df['POL_STATUS'] !='Live'

_, train, test = df.split_frame([0.95, 0.049], seed=1234)
h2o.export_file(train, 'insurance_churn_train.csv', force=True)
h2o.export_file(test, 'insurance_churn_test.csv', force=True)
g-eoj commented 3 years ago

Partially addresses #50