text_html_output_1.png
from xgboost import XGBRegressor

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

train_filepath = '../input/30-days-of-ml/train.csv'
test_filepath = '../input/30-days-of-ml/train.csv'
submission = '../input/30-days-of-ml/sample_submission.csv'

train = pd.read_csv(train_filepath)
test = pd.read_csv(test_filepath)

categorical_cols = [cname for cname in X_train_full.columns if X_train_full[cname].nunique() < 10 and X_train_full[cname].dtype == 'object']
numerical_cols = [cname for cname in X_train_full.columns if X_train_full[cname].dtype in ['int64', 'float64']]
my_cols = categorical_cols + numerical_cols
X_train = X_train_full[my_cols].copy()
X_valid = X_valid_full[my_cols].copy()
X_test = test[my_cols].copy()

X_train = pd.get_dummies(X_train)
X_valid = pd.get_dummies(X_valid)
X_test = pd.get_dummies(X_test)

my_model = XGBRegressor(n_estimators=1, learning_rate=0.05, n_jobs=5)
my_model.fit(X_train, y_train)