Suggestion : in exercice M2.01 add transparency to plt.errorbar

Hi,
in solution when validation curve of SVM is plotted some people could believe than there are no standard deviations for training scores for gammas <1 because on the graph these std are hidded by the testing scores’ ones. Adding transparency to the graph with the alpha parameter fix it:

plt.errorbar(gamma_param, train_scores.mean(axis=1),
             yerr=train_scores.std(axis=1), label='Training score')
plt.errorbar(gamma_param, test_scores.mean(axis=1),
             yerr=test_scores.std(axis=1), label='Testing score', alpha = 0.5)
plt.legend()

plt.xscale("log")
plt.xlabel(r"Value of hyperparameter $\gamma$")
plt.ylabel("Accuracy score")
_ = plt.title("Validation score of support vector machine")

image

The same commentary can be applied to the learning curves :wink:

It is a good suggestion indeed.

Addressed in Fix learning curve to show overlapped error bars by ArturoAmorQ · Pull Request #609 · INRIA/scikit-learn-mooc · GitHub

1 Like

This has been done now, thanks for the suggestion!

1 Like