@@ -0,0 +1,1687 @@
+#!/usr/bin/env python%0A%0Afrom sklearn.preprocessing import LabelEncoder%0Afrom xgboost.sklearn import XGBClassifier%0Aimport pandas as pd%0Afrom kairbnb.io import generate_submission%0A%0ANAME = 'gb_ensemble'%0A%0Aif __name__ == '__main__':%0A    train_users = pd.read_csv('../cache/train_users.csv4')%0A    test_users = pd.read_csv('../cache/test_users.csv4')%0A    sessions = pd.read_csv('../cache/train_users.csv5')%0A%0A    y_train = train_users%5B'country_destination'%5D%0A    train_users.drop(%5B'country_destination', 'id'%5D, axis=1, inplace=True)%0A    sessions.drop(%5B'country_destination', 'id'%5D, axis=1, inplace=True)%0A    train_users = train_users.fillna(-1)%0A    sessions = sessions.fillna(-1)%0A    x_train = train_users.values%0A    x_train_2 = sessions.values%0A    label_encoder = LabelEncoder()%0A    encoded_y_train = label_encoder.fit_transform(y_train)%0A    test_users_ids = test_users%5B'id'%5D%0A    test_users.drop('id', axis=1, inplace=True)%0A    test_users = test_users.fillna(-1)%0A    x_test = test_users.values%0A%0A    clf = XGBClassifier(%0A        max_depth=7,%0A        learning_rate=0.18,%0A        n_estimators=80,%0A        objective=%22multi:softprob%22,%0A        gamma=0,%0A        min_child_weight=1,%0A        max_delta_step=0,%0A        subsample=1,%0A        colsample_bytree=1,%0A        colsample_bylevel=1,%0A        reg_alpha=0,%0A        reg_lambda=1,%0A        scale_pos_weight=1,%0A        base_score=0.5,%0A        missing=None,%0A        silent=True,%0A        nthread=-1,%0A        seed=42%0A    )%0A%0A    clf.fit(x_train, encoded_y_train)%0A    y_pred = clf.predict_proba(x_test)%0A    clf.fit(x_train_2, encoded_y_train)%0A    y_pred += clf.predict_proba(x_test) * 0.3%0A%0A    generate_submission(y_pred, test_users_ids, label_encoder, name=NAME)%0A

Add ensemble