text_plain_output_1.png
from sklearn.model_selection import RandomizedSearchCV, GridSearchCV

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

import xgboost

train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')

y_train = train.y

train = train.iloc[:, 1:15]
test = test.iloc[:, 1:15]

des = pd.concat((train, test))

des = pd.get_dummies(des)
X_train = des.iloc[0:32967, :]
X_test = des.iloc[32967:41188, :]

params = {'learning_rate': [0.05, 0.1, 0.15, 0.2, 0.25, 0.3], 'max_depth': [3, 4, 5, 6, 8, 10, 12, 15], 'n_estimators': [10, 20, 30, 40, 50, 60, 70, 80, 90, 100], 'min_child_weight': [1, 3, 5, 7], 'gamma': [0.0, 0.1, 0.2, 0.3, 0.4], 'colsample_bytree': [0.3, 0.4, 0.5, 0.7]}

classifier = xgboost.XGBClassifier()

random_search = RandomizedSearchCV(classifier, param_distributions=params, n_iter=20, scoring='roc_auc', n_jobs=-1, cv=5, verbose=3)

random_search.fit(X_train, y_train)