title: Ranking and scores in Recursive Feature Elimination (RFE) in scikit-learn
body: <p>I am trying to understand how to read <code>grid_scores_</code> and <code>ranking_</code> values in <a href="http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.RFECV.html" rel="noreferrer">RFECV</a>. Here is the main example from the documentation:</p>
  
  <pre><code>from sklearn.datasets import make_friedman1
  from sklearn.feature_selection import RFECV
  from sklearn.svm import SVR
  X, y = make_friedman1(n_samples=50, n_features=10, random_state=0)
  estimator = SVR(kernel="linear")
  selector = RFECV(estimator, step=1, cv=5)
  selector = selector.fit(X, y)
  selector.support_ 
  array([ True,  True,  True,  True,  True,
          False, False, False, False, False], dtype=bool)
  
  selector.ranking_
  array([1, 1, 1, 1, 1, 6, 4, 3, 2, 5])
  </code></pre>
  
  <p>How am I supposed to read <code>ranking_</code> and <code>grid_scores_</code>? Is the <strong>lower</strong> the ranking <strong>value</strong> the better? (or viceversa?). The reason why ask this is because I have noticed that the features with the <strong>highest ranking</strong> value, have typically the highest scores in <code>grid_scores_</code>. </p>
  
  <p><strong>However, if something has a <code>ranking = 1</code> shouldn't  that mean that it was ranked as the best of the group?</strong>. This is also what the documentation <a href="http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.RFECV.html" rel="noreferrer">says</a>:</p>
  
  <blockquote>
    <p>"<em>Selected (i.e., estimated best) features are assigned rank 1</em>"</p>
  </blockquote>
  
  <p>But now let's look at the following example using some real data:</p>
  
  <pre><code>&gt; rfecv.grid_scores_[np.nonzero(rfecv.ranking_ == 1)[0]]
  0.0
  </code></pre>
  
  <p>while the feature with the <strong>highest</strong> ranking <strong>value</strong> has the <strong>highest</strong> *<em>score</em>*.</p>
  
  <pre><code>&gt; rfecv.grid_scores_[np.argmax(rfecv.ranking_ )]
  0.997
  </code></pre>
  
  <p>Note that in the example above, the features with <strong>ranking=1</strong> have the lowest score</p>
  
  <h2>Figure in the documentation:</h2>
  
  <p>On this matter, in <a href="http://scikit-learn.org/stable/auto_examples/plot_rfe_with_cross_validation.html#example-plot-rfe-with-cross-validation-py" rel="noreferrer">this figure</a> in the documentation, the <code>y</code> axis reads <code>"number of misclassifications"</code>, but it is plotting <code>grid_scores_</code> which used <code>'accuracy'</code> (?) as a scoring function. Shouldn't the <code>y</code> label read <code>accuracy</code>? (<strong>the higher the better</strong>) instead of <code>"number of misclassifications"</code> (<strong>the lower the better</strong>)</p>