title: Missing values in Categorical Variables in CatBoost (python)
body: <p>CatBoost can encode categorical variables which is great. However, when categorical features contain missing values in the form np.nan, they can't be processed. This is stated in CatBoost documentation here:
  <a href="https://catboost.ai/en/docs/concepts/algorithm-missing-values-processing" rel="nofollow noreferrer">cb missing values</a></p>
  <p>However, I read in this GitHub thread that CatBoost can in fact handle categorical variables with missing values.
  <a href="https://github.com/catboost/catboost/issues/1245" rel="nofollow noreferrer">github thread</a></p>
  <p>I tried a mini example to test it:</p>
  <pre class="lang-py prettyprint-override"><code>from catboost import CatBoostClassifier
  # Initialize data
  cat_features = [0, 1]
  train_data = [[&quot;a&quot;, np.nan, 1, 4, 5, 6],
                [&quot;a&quot;, &quot;b&quot;, 4, 5, 6, 7],
                [&quot;c&quot;, &quot;d&quot;, 30, 40, 50, 60]]
  train_labels = [1, 1, -1]
  eval_data = [[&quot;a&quot;, &quot;b&quot;, 2, 4, 6, 8],
               [&quot;a&quot;, &quot;d&quot;, 1, 4, 50, 60]]
  
  # Initialize CatBoostClassifier
  model = CatBoostClassifier(iterations=2,
                             learning_rate=1,
                             depth=2)
  # Fit model
  model.fit(train_data, train_labels, cat_features)
  
  </code></pre>
  <p>Here we get the error, because column <code>0</code>has null:</p>
  <pre><code>CatBoostError: Invalid type for cat_feature[non-default value idx=0,feature_idx=1]=nan : cat_features must be integer or string, real number values and NaN values should be converted to string.
  </code></pre>
  <p>How can I make this code work without manually filling the null value?</p>