Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the function that splits data into training and testing sets.
ML Python
from sklearn.model_selection import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to split features X and labels y into training and testing sets with 30% test size.
ML Python
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to correctly split data with a fixed random state for reproducibility.
ML Python
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=[1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to split data with 20% test size and shuffle enabled.
ML Python
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=[1], shuffle=[2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to split data with 25% test size, shuffle disabled, and random state 123.
ML Python
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=[1], shuffle=[2], random_state=[3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left