Kaggle competition: Santander Customer Satisfaction
<categorify><EOS> 
training = pd.read_csv(".. /input/train.csv", index_col=0)
 test = pd.read_csv(".. /input/test.csv", index_col=0)
 print(training.shape)
 print(test.shape)
 training = training.replace(-999999,np.nan)
 training=training.replace(9999999999,np.nan)
 X = training.iloc[:,:-1]
y = training.TARGET
X_train, X_test, y_train, y_test = cross_validation.train_test_split(X, y, stratify=y, test_size=0.3)
 ratio = float(np.sum(y == 1)) / np.sum(y==0)
 X_train, X_test, y_train, y_test = cross_validation.train_test_split(X, y, stratify=y, test_size=0.3)
 xgbooster = xgb.XGBClassifier(missing=np.nan,
max_depth = 5,
n_estimators=1000,
learning_rate=0.1,
nthread=4,
subsample=1.0,
colsample_bytree=0.5,
min_child_weight = 3,
scale_pos_weight = ratio,
reg_alpha=0.03,
seed=234)
 scorestrain=[]
scorescv=[]
iterations=[]
for i in range(1000,len(X_train),3000):
print(i)
 xgbooster.fit(X_train[:i], y_train[:i], early_stopping_rounds=50, eval_metric="auc",
eval_set=[(X_test, y_test)])
 scorestrain.append(roc_auc_score(y_train[:i], xgbooster.predict_proba(X_train[:i], ntree_limit=xgbooster.best_iteration)[:,1]))
scorescv.append(roc_auc_score(y_test,xgbooster.predict_proba(X_test,ntree_limit=xgbooster.best_iteration)[:,1]))
iterations.append(i)

plt.figure(figsize=(15,10))
plt.plot(iterations,scorestrain,'r')
 plt.plot(iterations,scorescv, 'b')
 plt.ylim(0.8,0.9)
 plt.xlim(1000,55000)
 plt.xlabel('
plt.ylabel('AUC')
 plt.legend(['Training Set','CV set'],loc='lower right')