title: Can sklearn random forest classifier handle categorical variables?
body: <p>I found <a href="https://stackoverflow.com/questions/24715230/can-sklearn-random-forest-directly-handle-categorical-features">this thread from 2014</a> and the answer states that no, sklearn random forest classifier cannot handle categorical variables (or at least not directly). Has the answer changed in 2020?</p>
  
  <p>I want to feed <code>gender</code> as a feature for my model. However, <code>gender</code> can take on three values: <code>M</code>, <code>F</code> of <code>np.nan</code>. If I encode this column into three dichotomous columns, how can the random forest classifier know that these three columns represent a single feature?</p>
  
  <p>Imagine <code>max_features</code> = 7. When training a given tree, it will randomly randomly pick seven features. Suppose <code>gender</code> was chosen. If <code>gender</code> is split into three columns (<code>gender_M</code>, <code>gender_F</code>, <code>gender_NA</code>), will the random forest classifier always pick all three columns and count it as one feature, or is there a chance that it will only pick one or two?</p>