text_html_output_1.png
from sklearn.impute import SimpleImputer

from sklearn.metrics import f1_score

from sklearn.neural_network import MLPClassifier

from sklearn.preprocessing import MinMaxScaler

import datetime

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

file_path = '../input/analyticsvjobathon/train_wn75k28.csv'
lead_data = pd.read_csv(file_path, index_col='id')
file_path2 = '../input/analyticsvjobathon/test_Wf7sxXF.csv'
X_test = pd.read_csv(file_path2, index_col='id')

X = lead_data.copy()
y = X.buy
X_full = X.drop(['buy'], axis=1)

X_full['created_at'] = pd.to_datetime(X_full['created_at'])
X_full['signup_date'] = pd.to_datetime(X_full['signup_date'])

dt = datetime.date.today()
today = pd.DatetimeIndex([dt])[0]
X_full['signup_date'] = today - X_full['signup_date']
X_full['created_at'] = today - X_full['created_at']

cols = X_train.columns
imp = SimpleImputer(strategy='constant')
scaler = MinMaxScaler()
X_train = imp.fit_transform(X_train)
X_valid = imp.transform(X_valid)
X_train = scaler.fit_transform(X_train)
X_valid = scaler.transform(X_valid)
X_train = pd.DataFrame(X_train, columns=[cols])
X_valid = pd.DataFrame(X_valid, columns=[cols])

model = MLPClassifier(random_state=1, hidden_layer_sizes=(30, 20), max_iter=250)
model.fit(X_train, y_train)
preds = model.predict(X_valid)
F1 = f1_score(y_valid, preds)
print(F1)