79181080

Date: 2024-11-12 12:27:34
Score: 1
Natty:
Report link

As per https://github.com/scikit-learn/scikit-learn/pull/20161 and https://github.com/scikit-learn/scikit-learn/issues/11198 , while cv_results_ replaces grid_scores_ you need to use mean_test_score ( or std_test_score ) along with it.

Try the below

plt.figure(figsize=(16, 9))
plt.title('Recursive Feature Elimination with Cross-Validation', fontsize=18, fontweight='bold', pad=20)
plt.xlabel('Number of features selected', fontsize=14, labelpad=20)
plt.ylabel('% Correct Classification', fontsize=14, labelpad=20)
plt.plot(range(1, len(rfecv.cv_results_['mean_test_score']) + 1), rfecv.cv_results_['mean_test_score'], color='#303F9F', linewidth=3)
#plt.plot(range(1, len(rfecv.cv_results_['std_test_score']) + 1), rfecv.cv_results_['std_test_score'], color='#309f51', linewidth=3)
plt.show()
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Vishal