0
0
ML Pythonprogramming~10 mins

Learning curves in ML Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the function that plots learning curves from sklearn.

ML Python
from sklearn.model_selection import [1]
Drag options to blanks, or click blank then click option'
Alearning_curve
Bcross_val_score
Ctrain_test_split
DGridSearchCV
Attempts:
3 left
2fill in blank
medium

Complete the code to generate training and validation scores for a model using learning_curve.

ML Python
train_sizes, train_scores, test_scores = learning_curve(estimator, X, y, cv=[1])
Drag options to blanks, or click blank then click option'
A0.5
B100
C5
D'auto'
Attempts:
3 left
3fill in blank
hard

Fix the error in the code to correctly compute the mean training scores.

ML Python
mean_train_scores = train_scores.[1](axis=1)
Drag options to blanks, or click blank then click option'
Amean
Bsum
Cmean(axis=0)
Daverage
Attempts:
3 left
4fill in blank
hard

Fill both blanks to plot training and validation scores against training sizes.

ML Python
plt.plot(train_sizes, mean_train_scores, label='[1]')
plt.plot(train_sizes, mean_test_scores, label='[2]')
Drag options to blanks, or click blank then click option'
ATraining score
BValidation score
CTest score
DAccuracy
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to complete the code that plots learning curves with labels and axis titles.

ML Python
plt.xlabel('[1]')
plt.ylabel('[2]')
plt.title('[3]')
Drag options to blanks, or click blank then click option'
ATraining examples
BScore
CLearning Curve
DAccuracy
Attempts:
3 left