title: Categorical features with Catboost Spark
body: <p>I am currently coding with <code>catboost_spark</code> version 1.0.3.</p>
  <p>When I try to run a regression I get this error message:</p>
  <pre><code>Internal CatBoost Error (contact developers for assistance): attempt to interpret non-binary feature as binary
  </code></pre>
  <p>My code looks like this:</p>
  <p>First I define the metadata that I'll integrate into my model:</p>
  <pre><code>meta = {'ml_attr': {'attrs': {'nominal': [{'idx': 0, 'name': 'categorical_feature', 'ord': False, 'vals': ['4', '6']}]}, 'num_attrs': 1}}
  </code></pre>
  <p>Then I define my spark dataframe, by initializing it as follows:</p>
  <pre><code>my_array = (
   Row(Vectors.dense('6'), &quot;1000.0&quot;),
   Row(Vectors.dense('4'), &quot;10004.0&quot;),
   Row(Vectors.dense('6'), &quot;10005.0&quot;)
  )
  
  my_df = spark.createDataFrame(spark.sparkContext.parallelize(my_array))\
      .withColumnRenamed(&quot;_1&quot;, &quot;features&quot;)\
      .withColumnRenamed(&quot;_2&quot;, &quot;label&quot;)\
      .withColumn(&quot;features&quot;, F.col(&quot;features&quot;).alias(&quot;features&quot;, metadata=meta))
  
  trainPool = Pool(my_df)
  </code></pre>
  <p>Once the dataframe has been created, I define the parameters of the <code>CatBoostRegressor</code> and fit it on the <code>trainPool</code>:</p>
  <pre><code>params = {
      'borderCount': 150,
      'depth': 3,
      'l2LeafReg': 2.8,
      'learningRate': 0.08,
      'rsm': 0.8,
      'lossFunction': 'Tweedie:variance_power=1.95',
      'evalMetric': 'Tweedie:variance_power=1.95',
      'scoreFunction': EScoreFunction(6), # 'L2',
      'iterations': 5000,
      'loggingLevel': ELoggingLevel(0), # 'Silent',
      'odType': EOverfittingDetectorType(3), # 'Iter',
      'odWait': 40,
      'threadCount': 7,
      'useBestModel': True,
      'allowWritingFiles': False,
      }
  
  model_test_test = CatBoostRegressor(**params)
  model_test_test = model_test_test.fit(trainPool)
  </code></pre>
  <p>It's here that I get the error. It seems that this error occurs when fitting the <code>CatBoostRegressor</code> to some data with a categorical feature containing values not included in the metadata. I already did some test, and it's not a problem due to the type of the data.</p>