title: Trouble training xgboost on categorical column
body: <p>I am trying to run a Python notebook (<a href="https://github.com/elena-petrova/rossmann_TSA_forecasts/blob/master/Rossmann_Sales.ipynb" rel="noreferrer">link</a>). At line below In [446]: where author train <code>XGBoost</code>, I am getting an error</p>
  
  <blockquote>
    <p>ValueError: DataFrame.dtypes for data must be int, float or bool.
                    Did not expect the data types in fields StateHoliday, Assortment</p>
  </blockquote>
  
  <pre><code># XGB with xgboost library
  dtrain = xgb.DMatrix(X_train[predictors], y_train)
  dtest = xgb.DMatrix(X_test[predictors], y_test)
  
  watchlist = [(dtrain, 'train'), (dtest, 'test')]
  
  xgb_model = xgb.train(params, dtrain, 300, evals = watchlist,
                        early_stopping_rounds = 50, feval = rmspe_xg, verbose_eval = True)
  </code></pre>
  
  <p>Here is the minimal code for testing</p>
  
  <pre><code>import pickle
  import numpy as np
  import xgboost as xgb
  from sklearn.model_selection import train_test_split
  
  with open('train_store', 'rb') as f:
      train_store = pickle.load(f)
  
  train_store.shape
  
  predictors = ['Store', 'DayOfWeek', 'Open', 'Promo', 'StateHoliday', 'SchoolHoliday', 'Year', 'Month', 'Day', 
                'WeekOfYear', 'StoreType', 'Assortment', 'CompetitionDistance', 'CompetitionOpenSinceMonth', 
                'CompetitionOpenSinceYear', 'Promo2', 'Promo2SinceWeek', 'Promo2SinceYear', 'CompetitionOpen', 
                'PromoOpen']
  
  y = np.log(train_store.Sales) # log transformation of Sales
  X = train_store
  
  # split the data into train/test set
  X_train, X_test, y_train, y_test = train_test_split(X, y, 
                                                      test_size = 0.3, # 30% for the evaluation set
                                                      random_state = 42)
  
  # base parameters
  params = {
      'booster': 'gbtree', 
      'objective': 'reg:linear', # regression task
      'subsample': 0.8,          # 80% of data to grow trees and prevent overfitting
      'colsample_bytree': 0.85,  # 85% of features used
      'eta': 0.1, 
      'max_depth': 10, 
      'seed': 42} # for reproducible results
  
  num_round = 60 # default 300
  
  dtrain = xgb.DMatrix(X_train[predictors], y_train)
  dtest  = xgb.DMatrix(X_test[predictors],  y_test)
  
  watchlist = [(dtrain, 'train'), (dtest, 'test')]
  
  xgb_model = xgb.train(params, dtrain, num_round, evals = watchlist,
                        early_stopping_rounds = 50, feval = rmspe_xg, verbose_eval = True)
  </code></pre>
  
  <p>Link to train_store data file: <a href="https://drive.google.com/file/d/15EJZJxDKAOZ890XetnGXQGh0usgB8Zsl/view?usp=sharing" rel="noreferrer">Link 1</a></p>