Validation curves

As learning curves operate on different sample sizes, validation curves estimate the training and cross-validation performance with respect to the values that a hyper-parameter can take. As in learning curves, similar considerations can be applied, though this particular visualization will grant you further insight about the optimization behavior of your parameter, visually suggesting to you the part of the hyper-parameter space that you should concentrate your search on:

In: from sklearn.learning_curve import validation_curve    testing_range = np.logspace(-5,2,8)    hypothesis = SGDClassifier(loss='log', shuffle=True,                                n_iter=5, penalty='l2',                                alpha=0.0001, random_state=3)    train_scores, test_scores = validation_curve(hypothesis, ...

Get Python Data Science Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.