title: Why does `categorical_feature` of lightgbm not work?
body: <p>I want to use <code>LightGBM</code> to predict the <code>tradeMoney</code> of house, but I get troubles when I have specified <code>categorical_feature</code> in the <code>lgb.Dataset</code> of <code>LightGBM</code>.<br>
  I get <code>data.dtypes</code> as follows:</p>
  
  <pre><code>type(train)
  pandas.core.frame.DataFrame
  
  train.dtypes
  area                  float64
  rentType               object
  houseFloor             object
  totalFloor              int64
  houseToward            object
  houseDecoration        object
  region                 object
  plate                  object
  buildYear               int64
  saleSecHouseNum         int64
  subwayStationNum        int64
  busStationNum           int64
  interSchoolNum          int64
  schoolNum               int64
  privateSchoolNum        int64
  hospitalNum             int64
  drugStoreNum            int64
  </code></pre>
  
  <p>And I use <code>LightGBM</code> to train it as follows:</p>
  
  <pre><code>categorical_feats = ['rentType', 'houseFloor', 'houseToward', 'houseDecoration', 'region', 'plate']
  folds = KFold(n_splits=5, shuffle=True, random_state=2333)
  
  oof_lgb = np.zeros(len(train))
  predictions_lgb = np.zeros(len(test))
  feature_importance_df = pd.DataFrame()
  
  for fold_, (trn_idx, val_idx) in enumerate(folds.split(train.values, target.values)):
      print("fold {}".format(fold_))
      trn_data = lgb.Dataset(train.iloc[trn_idx], label=target.iloc[trn_idx], categorical_feature=categorical_feats)
      val_data = lgb.Dataset(train.iloc[val_idx], label=target.iloc[val_idx], categorical_feature=categorical_feats)
  
      num_round = 10000
      clf = lgb.train(params, trn_data, num_round, valid_sets = [trn_data, val_data], verbose_eval=500, early_stopping_rounds = 200)
  
      oof_lgb[val_idx] = clf.predict(train.iloc[val_idx], num_iteration=clf.best_iteration)
  
      predictions_lgb += clf.predict(test, num_iteration=clf.best_iteration) / folds.n_splits
  
  print("CV Score: {:&lt;8.5f}".format(r2_score(target, oof_lgb)))
  </code></pre>
  
  <p>BUT it still gives such error messages even if I have specified the <code>categorical_features</code>.</p>
  
  <blockquote>
    <p>ValueError: DataFrame.dtypes for data must be int, float or bool. Did
    not expect the data types in fields rentType, houseFloor, houseToward,
    houseDecoration, region, plate</p>
  </blockquote>
  
  <p>And here are the requirements:</p>
  
  <blockquote>
    <p>LightGBM version:  2.2.3<br> 
    Pandas version: 0.24.2<br> 
    Python version: 3.6.8<br>
    |Anaconda, Inc.| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit
    (AMD64)]</p>
  </blockquote>
  
  <p>Could anyone help me, please?</p>