title: How do I solve overfitting in random forest of Python sklearn?
body: <p>I am using RandomForestClassifier implemented in python sklearn package to build a binary classification model. The below is the results of cross validations:</p>
  
  <pre><code>Fold 1 : Train: 164  Test: 40
  Train Accuracy: 0.914634146341
  Test Accuracy: 0.55
  
  Fold 2 : Train: 163  Test: 41
  Train Accuracy: 0.871165644172
  Test Accuracy: 0.707317073171
  
  Fold 3 : Train: 163  Test: 41
  Train Accuracy: 0.889570552147
  Test Accuracy: 0.585365853659
  
  Fold 4 : Train: 163  Test: 41
  Train Accuracy: 0.871165644172
  Test Accuracy: 0.756097560976
  
  Fold 5 : Train: 163  Test: 41
  Train Accuracy: 0.883435582822
  Test Accuracy: 0.512195121951
  </code></pre>
  
  <p>I am using "Price" feature to predict "quality" which is a ordinal value. In each cross validation, there are 163 training examples and 41 test examples. </p>
  
  <p>Apparently, overfitting occurs here. So is there any parameters provided by sklearn can be used to overcome this problem? I found some parameters <a href="http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html">here</a>, e.g. min_samples_split and min_sample_leaf, but I do not quite understand how to tune them.</p>
  
  <p>Thanks in advance!</p>