title: Random Forest: Why does feature correlation not correspond to feature importance?
body: <p>I generated a dataset with 15 features. Feature 9-15 are linearly dependant on feature 1-7 (I generated the data that way.)
  This correlation plot proves this behaviour:</p>
  
  <pre><code>corr = pd.DataFrame(X, columns=['F1', 'F2', 'F3', 'F4', 'F5',
                              'F6', 'F7', 'F8', 'F9', 'F10',
                              'F11', 'F12', 'F13', 'F14', 'F15']).corr()
  
  sns.heatmap(corr)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/feOgj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/feOgj.png" alt="enter image description here"></a>
      When I plot the feature importances from random forest clf I expect those highly correlating features to be of no importance. So this surprises me:</p>
  
  <pre><code>clf = RandomForestClassifier(n_estimators=5)
  clf.fit(X_train, y_train)
  
  feature_names = ['F1', 'F2', 'F3', 'F4', 'F5',
                   'F6', 'F7', 'F8', 'F9', 'F10',
                   'F11', 'F12', 'F13', 'F14', 'F15']
  
  importances = pd.DataFrame(clf.feature_importances_, index=feature_names,
                             columns=['importance']).sort_values('importance', ascending=False)
  
  importances.plot(kind='barh')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/n6m0a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n6m0a.png" alt="enter image description here"></a></p>
  
  <p>Why are feature 9-15 important afterall? What happens if I apply PCA to the data?</p>