Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scikit-learn: Issues on RFECV example

I'm having a difficulty in understanding the given RFECV example in current documentation. In the plot it's been written as "nb of misclassifications", so i expect it to be "lower the better". But in the example plot the best has been chosen as the highest cross-validation score. So i naturally expect it to be something related to accuracy (scoring says accuracy in the code anyways). But then how it becomes higher than 1?

I am a bit confused on how to interpret these results. I would appreciate any help on this.

Thanks!

like image 381
jatha Avatar asked Feb 08 '26 02:02

jatha


1 Answers

RFECV has a useful verbose option. Running with verbose=2, you can see, that for a 2-fold cross-value check, as in example, grid_scores_ holds sum of both folds scores.

In general, for a n-fold check, grid_scores_ is sum of folds scores divided by n-1, see in code. It seems to be a bug; see somewhat relevant issue on the tracker.

like image 66
alko Avatar answered Feb 09 '26 16:02

alko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!