title: Random Forest Regression - How do I analyse its performance? - python, sklearn
body: <p>I'm struggling to assess the performance of my random forest - I've looked at the mean relative error, but I'm not sure if it's a good indicator. What are some things to check for?</p>
  
  <p>Also, how should I optimise my hyperparameters? 
  I've used <code> rf.score(X_test,y_test) </code> R2, but is that really the only thing I should rely on when doing regressions? I had a look into out of bag scores, but I'm not sure how to interpret them.</p>
  
  <p>May your optima be global and your hyper-parameters optimized :)</p>
  
  <pre><code>from sklearn.ensemble import RandomForestRegressor
  
  rf = RandomForestRegressor(n_estimators = 1000,max_depth=5,random_state = 0)
  rf.fit(X_train, y_train);
  
  predictions = rf.predict(X_test)
  
  
  errors = abs((predictions - y_test)/y_test)
  print('Mean Relative Error:', round(np.mean(errors), 2)) 
  </code></pre>