title: Discretizing continuous variables for RandomForest in Sklearn
body: <p>I want to use Random Forest for feature selection based on Gini index. My dataset has mix of numeric (contiuous) and categorical(String) data. This is an example of the dataset </p>
  
  <p>Var1            Var2<br>
  198             zcROj17IEC
  336             DHeTmBftjz
  252.3           crIgUHSK8h
  252             ZSNrjIX0Db</p>
  
  <p>I know trees works on discrete data (categorical) but does RandomForest in Sklearn require continuous numeric data to be discretized first or it can handle it?? For categorical string variables I used the following to encode the strings into numeric columns with zeros and ones </p>
  
  <pre><code>pandas.get_dummies(X['Var2'])
  </code></pre>
  
  <p>and it works but for the numeric I tried the following to discretize</p>
  
  <pre><code>pandas.qcut(X['Var1'], 2 , retbins=True) 
  </code></pre>
  
  <p>but I keep getting an error of non-unique bins!</p>
  
  <p>Do I need to discretize? How can I do it?</p>