title: CatBoostError: cat_features must be integer or string, real number values and NaN values should be converted to string
body: <p>I have a dataset with 122 columns which looks like:</p>
  
  <pre><code>train.head()
  
  SK_ID_CURR  TARGET  NAME_CONTRACT_TYPE  CODE_GENDER FLAG_OWN_CAR    FLAG_OWN_REALTY CNT_CHILDREN    AMT_INCOME_TOTAL    AMT_CREDIT  AMT_ANNUITY ... FLAG_DOCUMENT_18    FLAG_DOCUMENT_19    FLAG_DOCUMENT_20    FLAG_DOCUMENT_21    AMT_REQ_CREDIT_BUREAU_HOUR  AMT_REQ_CREDIT_BUREAU_DAY   AMT_REQ_CREDIT_BUREAU_WEEK  AMT_REQ_CREDIT_BUREAU_MON   AMT_REQ_CREDIT_BUREAU_QRT   AMT_REQ_CREDIT_BUREAU_YEAR
  0   100002  1   Cash loans  M   N   Y   0   202500.0    406597.5    24700.5 ... 0   0   0   0   0   0   0   0   0   1
  1   100003  0   Cash loans  F   N   N   0   270000.0    1293502.5   35698.5 ... 0   0   0   0   0   0   0   0   0   0
  2   100004  0   Revolving loans M   Y   Y   0   67500.0 135000.0    6750.0  ... 0   0   0   0   0   0   0   0   0   0
  3   100006  0   Cash loans  F   N   Y   0   135000.0    312682.5    29686.5 ... 0   0   0   0   255 255 255 255 65535   255
  4   100007  0   Cash loans  M   N   Y   0   121500.0    
  </code></pre>
  
  <p>I've imputed all NaNs and wanna use CatBoost now as follows:</p>
  
  <pre><code># Get variables for a model
  x = train.drop(["TARGET"], axis=1)
  y = train["TARGET"]
  
  #Do train data splitting
  X_train, X_test, y_train, y_test = train_test_split(x,y, test_size=0.2, random_state=42)
  
  cat_features = np.where(x.dtypes != float)[0]
  
  cat = CatBoostClassifier(one_hot_max_size=7, iterations=21, random_seed=42, use_best_model=True, eval_metric='Accuracy', loss_function='Logloss')
  
  cat.fit(X_train, y_train, cat_features = cat_features, eval_set=(X_test, y_test))
  pred = cat.predict(X_test)
  
  pool = Pool(X_train, y_train, cat_features=cat_features)
  cv_scores = cv(pool, cat.get_params(), fold_count=10, plot=True)
  print('CV score: {:.5f}'.format(cv_scores['test-Accuracy-mean'].values[-1]))
  print('The test accuracy is :{:.6f}'.format(accuracy_score(y_test, cat.predict(X_test))))
  </code></pre>
  
  <p>which raises:</p>
  
  <blockquote>
    <p>CatBoostError: Invalid type for cat_feature[534,6]=118975.5 :
    cat_features must be integer or string, real number values and NaN
    values should be converted to string.</p>
  </blockquote>
  
  <p><code>NaN</code>s all are imputed as mentioned (checked) and in the code is stated that <code>cat_features</code> are other than real numbers.</p>
  
  <p>Would someone help me to solve the mystery, please?</p>