text_plain_output_1.png
from sklearn.preprocessing import LabelEncoder

import pandas as pd

ks = pd.read_csv('../input/kickstarter-projects/ks-projects-201801.csv', parse_dates=['deadline', 'launched'])

pd.unique(ks.state)

ks.groupby('state')['ID'].count()

ks = ks.query('state != "live"')
ks = ks.assign(outcome=(ks['state'] == 'successful').astype(int))

ks = ks.assign(hour=ks.launched.dt.hour, day=ks.launched.dt.day, month=ks.launched.dt.month, year=ks.launched.dt.year)

cat_features = ['category', 'currency', 'country']
encoder = LabelEncoder()
encoded = ks[cat_features].apply(encoder.fit_transform)
encoded.head(10)