title: Random forest: balancing test set?
body: <p>I am trying to run a Random Forest Classifier on an imbalanced dataset (~1:4).</p>
  
  <p>I am using the method from imblearn as follows:</p>
  
  <pre><code>from imblearn.ensemble import BalancedRandomForestClassifier
  
  rf=BalancedRandomForestClassifier(n_estimators=1000,random_state=42,class_weight='balanced',sampling_strategy='not minority')
  rf.fit(train_features,train_labels) 
  predictions=rf.predict(test_features)
  </code></pre>
  
  <p>The split in training and test set is performed within a cross-validation approach using <code>RepeatedStratifiedKFold</code> from scikit learn.</p>
  
  <p>However, I wonder if the test set needs to be balanced as well in order to obtain sensible accuracy scores (sensitivity, specificity etc.). I hope you can help me with this.</p>
  
  <p>Many thanks!</p>