text_plain_output_1.png
from sklearn.cross_validation import train_test_split

import numpy as np

import xgboost as xgb

ids = test['id']
test = test.drop(['id'], axis=1)
y = train['Demanda_uni_equil']
X = train[test.columns.values]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=1729)

test_preds = np.zeros(test.shape[0])
xg_train = xgb.DMatrix(X_train, label=y_train)
xg_test = xgb.DMatrix(X_test)
watchlist = [(xg_train, 'train')]