Font size
WorksheetsRecall: Error Metrics and Model Selection Basics
Total questions: 101
Worksheet time: 51mins
In regression, which expression correctly defines the Mean Square Error (MSE) over N observations?
MSE = (1/N)Σi=1N∣yi−y^i∣
MSE = (1/N)Σi=1N(yi−y^i)2
MSE = Σi=1N(yi−y^i)
MSE = (1/N2)Σi=1N(yi−y^i)2
For classification, the error rate shown is (1/N)Σi=1NI(yi=y^i) . What does the indicator function I(yi=y^i) contribute to the sum?
It adds the squared difference when predictions disagree.
It adds 1 for a misclassification and 0 otherwise.
It adds the absolute difference between class labels.
It subtracts 1 when predictions match and adds 0 otherwise.
In the MSE and error rate definitions, what do y_i and ŷ_i represent, respectively?
The i-th residual and the i-th squared error
The i-th observation and its estimate
The i-th predicted value and the model’s parameter
The i-th feature value and its standardized form
Suppose a regression model produces predictions ŷ = [2, 4, 6] for true values y = [1, 5, 7]. What is the MSE using the given formula?
(1/3)⋅[(1−2)2+(5−4)2+(7−6)2]=(1/3)⋅[1+1+1]=1
(1/3)·[(1−2) + (5−4) + (7−6)] = (1/3)·[1 + 1 + 1] = 1
(1/9)⋅[(1−2)2+(5−4)2+(7−6)2]=1/3
(1/3)·|[(1−2) + (5−4) + (7−6)]| = 1
Which scenario best motivates using error rate instead of MSE for model evaluation?
Predicting numeric outcomes like house prices.
Estimating continuous temperatures from sensor data.
Classifying emails as spam or not spam.
Fitting a polynomial curve to measured positions.
When selecting a model for tabular classification, which statement aligns with the listed options (KNN, Logistic Regression, Random Forest)?
Only Random Forest can handle tabular data; KNN and Logistic Regression cannot.
KNN, Logistic Regression, and Random Forest are common choices whose advantages can be compared for the best fit.
Logistic Regression is suitable only for regression tasks, not classification.
KNN requires no notion of distance among data points in its design.
In supervised regression, which statement best distinguishes training error from test error?
Training error is the average error on the training dataset; test error is the average error on new observations not used in training.
Training error is measured with classification accuracy; test error is measured with mean squared error.
Training error equals zero for any properly trained model; test error is nonzero.
Training error depends only on model complexity; test error depends only on dataset size.
A model shows very low error on the training set but substantially higher error on unseen data. Which phenomenon is most consistent with this observation?
Underfitting due to high bias and low variance
Proper generalization with balanced bias-variance
Overfitting due to low bias and high variance
Data leakage eliminated by strict separation
Which reason explains why training error can dramatically underestimate test error?
Training error is computed using a loss different from the test loss.
Training error benefits from having seen the exact samples used to fit the parameters, while test error evaluates performance on new, unseen samples.
Test error is always inflated by random noise added at evaluation time.
Training error uses larger datasets than test error by design.
Consider the plotted curves of prediction error versus model complexity with separate lines for training and test samples. What general trend is depicted for the test error as complexity increases beyond an optimal point?
Test error continually decreases with complexity.
Test error decreases at first, reaches a minimum, then increases as complexity becomes too high.
Test error is constant across all complexity levels.
Test error mirrors the training error exactly at every complexity level.
On the bias-variance spectrum shown on the diagram, which region corresponds to overfitting?
High bias, low variance (left side of the complexity axis)
Low bias, high variance (right side of the complexity axis)
Moderate bias and variance (center)
Bias and variance both zero (anywhere)
Which description aligns with underfitting in the context of model complexity and error?
Model too simple, high bias, low variance, leading to high error on both training and test sets.
Model too complex, low bias, high variance, leading to low training error but high test error.
Model with perfect complexity, achieving zero test error.
Model with high variance and low bias but low training error only.
According to the notes, models that are too complex for the amount of training data available tend to:
Generalize well to new examples.
Overfit, exhibiting high variance and low bias.
Underfit, exhibiting high bias and low variance.
Match training and test errors exactly.
Which question from the material prompts consideration of data size as a remedy for overfitting?
Can regularization increase variance?
Can very large datasets solve this problem?
Is training error equal to test error?
Should we always use linear models?
Generalization ability is defined as an algorithm’s capacity to:
Minimize training loss without constraints.
Give accurate predictions for new, previously unseen data.
Maximize the number of parameters in a model.
Reduce variance to zero regardless of bias.
Which assumption underlies evaluation on a test set when discussing generalization?
The test set follows a different distribution than the training set.
Future unseen data will share the same distributional properties as the training sets.
Training accuracy is always higher than test accuracy.
The model must be tuned only on the test set for fairness.
Given the assumptions, why might a model accurate on the training set not be accurate on the test set?
The model was tuned too specifically to the training set, reducing its ability to generalize.
The test set always contains fewer samples than the training set.
Accuracy cannot be computed on unseen data.
Training and test sets must be identical to compare accuracy.
Which scenario most likely yields the lowest training error according to the diagram and discussion?
A highly complex model that continues reducing training error as complexity increases.
A simple model with high bias.
A model at the complexity minimizing test error.
A model trained on a test set only.
Which pair correctly matches model property with expected behavior on training and test sets?
High bias, low variance: low training error, low test error
Low bias, high variance: very low training error, higher test error
Low bias, low variance: high training error, high test error
High bias, high variance: optimal generalization
According to the definition provided, what is the core idea of cross-validation for estimating test error?
Training on the full dataset multiple times to reduce variance
Holding out a subset of training observations during fitting and applying the learning method to those held-out observations
Using only the test set for parameter tuning and final evaluation
Randomly shuffling labels to detect model bias
In the depicted workflow diagram, which step uses the held-out data to choose model settings before retraining on the full training data?
Final evaluation
Best parameters selection via cross-validation
Dataset split into training and test sets
Retrained model inference
Which statement best describes why the validation set approach is introduced?
To increase the size of the test set for better evaluation
To avoid overfitting that results from using the test set multiple times to select hyperparameters
To ensure models always have low bias by reducing training data
To eliminate variance by averaging across many folds
Which description correctly defines a hyperparameter in this context?
A learned weight that minimizes training loss
A parameter set after training to adjust model outputs
A configurable setting that defines some part of the model’s learning process
A constant that fixes the dataset split ratio
Based on the validation-test approach description, what operational step characterizes it?
Using the entire dataset for both fitting and evaluation
Holding out a subset of training observations from fitting and applying the learning method to those held-out observations
Fitting on the test set and validating on the training set
Selecting parameters by minimizing test error directly
Which is listed as a pro of the validation set approach?
High accuracy regardless of sampling
Fast and simple
Guaranteed unbiased error estimate
Eliminates variance in parameter selection
Which is a stated con of the validation set approach?
Requires complex implementation and long runtimes
Validation error always underestimates the true error
Results are highly variable depending on the particular sampling
Cannot be used to select hyperparameters
What tendency of validation error is noted in the material?
It tends to exactly match the true error
It tends to underestimate the true error
It tends to overestimate the true error
It is unrelated to the true error
In the validation set approach shown, the dataset is first split using train_test_split with test_size=0.4 and random_state=0. What proportion of the data becomes the test set in this first split?
20%
40%
50%
60%
After the first split, a second train_test_split is applied to the training+validation portion with test_size=0.2 and random_state=0 to create X_train, X_val, y_train, y_val. Relative to the train+validation pool, what fraction is allocated to the validation set?
0.1
0.2
0.3
0.4
The Breast Cancer Wisconsin dataset is loaded via datasets.load_breast_cancer(return_X_y=True). Which classifier is used to evaluate different hyperparameter values in the example?
LogisticRegression
DecisionTreeClassifier
KNeighborsClassifier
SVC
In the hyperparameter search loop, neighbors = np.arange(1, 15, 2). What values of n_neighbors are evaluated?
1 through 14 with step 1
1, 3, 5, ..., 13
2, 4, 6, ..., 14
5, 7, 9, ..., 15
Based on the plotted validation accuracy versus n_neighbors, and the printed output, which n_neighbors gives the best validation score and what is that score?
n_neighbors=9 with score≈0.975
n_neighbors=11 with score≈0.981
n_neighbors=13 with score≈0.970
n_neighbors=7 with score≈0.960
After selecting the best n_neighbors, the model is refit on X_trainval, y_trainval and evaluated on X_test, y_test. What is the reported test-set accuracy?
0.945
0.965
0.981
0.972
In the validation set approach, why can the estimated test error be highly variable across different runs?
Because the loss function itself changes randomly with each run
Because the split of observations between the training and validation sets varies, altering which data the model sees
Because model parameters are fixed and thus amplify noise
Because validation errors are averaged over many distinct models
According to the drawbacks listed, why might the validation set error tend to overestimate the test error for a model fit on the entire data set?
The validation set is always larger than the training set
The model is trained on only a subset of observations, so it has less data than it would when fit on the full data set
Validation metrics inherently bias downward
The training algorithm stops early during validation
Which statement best captures a limitation of training with a single validation split?
It guarantees identical performance estimates across splits
It ensures the model uses all observations equally
It uses only the observations assigned to the training set for fitting, potentially missing important patterns
It removes the need for hyperparameter tuning
What primary goal motivates the introduction of resampling methods in model assessment?
To decrease the number of observations needed in a study
To obtain more robust estimates of model performance when multiple separate training/testing sets are not available
To replace statistical inference with deterministic rules
To eliminate the need for a validation set entirely
Which actions are core to resampling techniques as described?
Drawing one large sample once and fixing the model
Repeatedly drawing samples from a training set and refitting the model on each sample
Only evaluating a single hyperparameter setting
Aggregating predictions without refitting
What additional benefit do resampling methods provide beyond a single train/validation split?
They guarantee zero test error
They provide additional information about the fitted model that would not otherwise be available
They reduce computational cost in all scenarios
They ensure the training set never changes
Which resampling techniques are explicitly named as examples?
Bagging and boosting
Cross-validation (CV) and bootstrapping
Grid search and random search
Regularization and ensembling
What is one noted drawback of resampling approaches?
They cannot be implemented on modern computers
They are computationally expensive, though less so now due to advances in computing power
They always underfit the data
They require labeled data to be discarded
In the automobile data example, the left plot shows mean squared error versus degree of polynomial for a single split. What does the right plot illustrate by contrast?
A single fit with regularization only
Multiple splits, each tracing mean squared error across polynomial degrees
A time series of model errors
A comparison between classification and clustering
In the automobile data example, the dataset contains 392 observations and is split into equal halves. Which variables are listed as features besides mpg?
cylinders, displacement, horsepower, weight, acceleration, year, origin, name
cylinders, torque, horsepower, curb weight, acceleration, model, country, manufacturer
gears, torque, horsepower, mass, speed, date, origin, label
displacement, efficiency, horsepower, load, acceleration, date, origin, code
In Leave-One-Out Cross-Validation (LOOCV), how are the training and validation sets formed for each iteration?
The data is split once into fixed 50% training and 50% validation subsets.
All observations except one form the training set, and the held-out single observation forms the validation set.
Random disjoint halves of the data are used as training and validation, repeated k times.
Each iteration uses a different 70/30 split between training and validation.
Which statement best describes how LOOCV estimates the test error?
It chooses the smallest MSE from all iterations.
It averages the mean squared errors across all n validation folds, one per observation.
It multiplies the training error by a penalty factor for model complexity.
It uses a bootstrap estimate of prediction error without averaging.
Suppose a dataset has n observations. How many distinct validation sets are created in LOOCV?
1
log2(n)
n
n−1
Consider the formula CV(n)=(1/n)i=1∑nMSEi shown in the material. What does MSE_i represent in this context?
The training error on the i-th training set.
The mean squared error computed on the single held-out observation in fold i.
The average MSE across all observations.
The MSE of a model fit to the entire dataset without cross-validation.
Which of the following is a characteristic of LOOCV compared to the simple validation set approach?
LOOCV tends to overestimate the test error rate.
LOOCV tends not to overestimate the test error rate relative to the validation set approach.
LOOCV always produces zero test error.
LOOCV ignores the degree of the fitted polynomial.
In the schematic diagram, the first training set contains all observations except observation 1, the second contains all except observation 2, and so on. What is the validation set in the second iteration?
All observations except observation 2.
Only observation 2.
Observations 1 and 2.
No observations; validation uses training error.
When applying LOOCV to select a polynomial degree for predicting mpg from horsepower (as in the plot), what quantity is evaluated across degrees?
Training accuracy.
Mean Squared Error estimated by LOOCV.
Number of parameters in the model.
Residual sum of squares on the full dataset.
In k-fold cross-validation, which step correctly describes how the data is used across folds? Choose the best description.
Use all folds only as training data and report a single score.
Use fold-1 as test data while the remaining folds serve as training data; repeat for each fold and aggregate scores.
Randomly select one observation as test and train on the rest without repeating.
Train one model on the entire dataset and validate on a separate external dataset only.
Which statement best captures a benefit of using k-fold cross-validation mentioned in the material?
It eliminates the need to train multiple models.
It guarantees zero bias in the evaluation.
It provides more stable estimates by training multiple models and uses a larger fraction of data for training.
It always uses 100% of the data for training in each fold.
When using 10-fold cross-validation, approximately what proportion of the data is used for training in each iteration?
10%
50%
90%
100%
According to the schematic of 5-fold CV, how is test error estimated?
By selecting the lowest MSE across folds.
By averaging the five resulting MSE estimates from the validation folds.
By averaging training losses only.
By computing the median residual across all observations.
Which formula defines the overall cross-validation score for regression across K parts as presented?
CV(K) = MSEtrain + MSEtest
CV(K) = (1/K)k=1∑KMSEk
CV(K) = k=1∑K(nk/n)MSEk
CV(K) = i=1∑n(yi−y^i)2
In the definition of MSE_k used in the regression details, what is ŷ_i?
The true response for observation i.
The residual for observation i within part k.
The fit (predicted value) for observation i obtained from data with part k excluded.
The average response across all folds.
If n is a multiple of K, what is the relationship between n_k and n in each part k according to the material?
n_k = K/n
n_k = n/K
n_k = n − K
n_k = K
Setting K = n corresponds to which special case of cross-validation?
Stratified k-fold
Repeated k-fold
n-fold or leave-one-out cross-validation (LOOCV)
Holdout validation
Which drawback of k-fold cross-validation is directly tied to training many models as K increases?
Lower computational cost
Higher computational cost
Guaranteed absence of data leakage
Perfect suitability for sequential data
Which situation is noted as problematic for standard k-fold cross-validation?
Balanced datasets with independent observations
Highly imbalanced datasets and sequential data
Small datasets with no labels
High-dimensional features only
What is the bias–variance implication of choosing a small k (e.g., 3-fold) as described?
Lower bias and higher variance with heavy computation.
Higher bias and lower computational cost due to fewer training samples.
Higher bias and lower computational cost due to more training samples.
Higher bias and lower variance with heavy computation.
What is the bias–variance implication of choosing a large k (e.g., 20-fold or leave-one-out) according to the material?
Lower bias, but high variance and heavy computation.
Higher bias, low variance, light computation.
Lower bias, low variance, light computation.
Higher bias, high variance, heavy computation.
Which risk is mentioned as a potential issue in k-fold cross-validation that can compromise evaluation integrity?
Over-regularization of the model
Data leakage or overlap between folds
Insufficient number of features
Excessive label noise always present
Based on the left diagram titled "LOOCV vs 5-fold CV", which statement best describes how LOOCV partitions the data for validation? Refer to the visual showing many rows where a single orange block shifts position across rows.
It splits the dataset into five equal folds and validates on one fold at a time.
It leaves out exactly one observation at a time for validation while training on the remaining n−1 observations.
It randomly holds out half the data for validation and trains on the other half.
It validates on all observations simultaneously without retraining.
In the right diagram labeled "5-fold CV", what does each orange segment within a row represent? Use the depiction of blue training blocks with a moving orange validation block.
The cumulative validation error across all folds.
A single fold used as the validation set while the remaining folds serve as training data.
An outlier removed before fitting the model.
A bootstrap resample used for training.
According to the caption beneath the first figure, which relationship between LOOCV and k-fold CV is correct?
LOOCV is unrelated to k-fold CV.
LOOCV is a special case of k-fold CV when k = 1.
LOOCV equals k-fold CV when k = N − 1.
LOOCV becomes k-fold CV only when k = 5.
From the second set of plots comparing LOOCV and 10-fold CV across polynomial degrees, which feature is highlighted for 10-fold CV by the note "Run 9 times"?
10-fold CV requires no repetition because folds are fixed.
10-fold CV is typically repeated multiple times with different splits to stabilize the estimate.
10-fold CV trains on fewer observations than LOOCV in each repetition, leading to higher bias by design.
10-fold CV can only be applied to linear models, hence the repetitions.
Inspect the LOOCV plot of Mean Squared Error versus Degree of Polynomial. What overall pattern is depicted across degrees 2 to 10?
Error increases sharply with degree.
Error drops from degree 2 and then remains relatively flat with slight variations.
Error oscillates dramatically with large spikes at every degree.
Error is constant across all degrees.
Comparing the two plots, which statement best characterizes the variance of the estimated error between LOOCV and 10-fold CV?
LOOCV shows more variability across repetitions than 10-fold CV.
10-fold CV shows visible variability across runs (multiple colored lines), while LOOCV presents a single, less variable estimate per degree.
Both methods display identical variability across runs.
Neither method involves variability because each uses the full dataset for both training and validation.
Using the comparison table structure titled "LOOCV vs k-fold CV (1
LOOCV: low complexity, high bias, low variance; k-fold (1
LOOCV: high computational complexity, low bias, higher variance of the estimate; k-fold (1
LOOCV: low computational complexity, low bias, high variance; k-fold (1
LOOCV and k-fold (1
Suppose N is the dataset size. Which statement is consistent with the visuals about training set sizes in LOOCV versus 5-fold CV?
In LOOCV, each model trains on N observations; in 5-fold CV, each model trains on N/5 observations.
In LOOCV, each model trains on N−1 observations; in 5-fold CV, each model trains on roughly 4N/5 observations.
In LOOCV, each model trains on N/2 observations; in 5-fold CV, each model trains on N−1 observations.
Both methods train on exactly the same number of observations per model.
In the gold standard workflow for model assessment, which step ensures an unbiased estimate of generalization performance?
Using k-fold splits within the training data to tune hyperparameters
Retraining the model on the full training data with the best-found parameters
Evaluating the final model on the held-out test data that was not used in training or tuning
Averaging validation scores across folds to select the highest-performing parameter set
A dataset is split into training data (X_train, y_train) and test data (X_test, y_test). Which statement correctly describes the role of k-fold cross-validation in this setup?
It is performed on the test data to estimate training error
It is performed on the training data to find and select model parameters
It is applied after final evaluation to reduce test error
It replaces the need for a separate test set entirely
After selecting the best hyperparameters via k-fold cross-validation on the training split, what is the next recommended step before evaluating the model?
Freeze the current fold-trained model and evaluate it directly on the test data
Retrain a model using only the best-performing single fold
Retrain the model using the entire training dataset with the chosen parameters
Combine training and test data to increase sample size and then evaluate
Which practice best matches the described gold standard approach for assessing a model?
Tune on all data, then evaluate using the same data to maximize accuracy
Use k-fold cross-validation on the training split, retrain on full training data, and finally evaluate once on the untouched test set
Skip cross-validation and select parameters based on intuition; evaluate on the training set
Perform k-fold cross-validation on the test set to ensure fair parameter tuning
In scikit-learn, which function is used to evaluate an estimator across cross-validation splits and return an array of scores?
GridSearchCV
cross_val_score
cross_validate
validation_curve
When using cross_val_score without specifying the scoring parameter, which scoring is applied at each cross-validation iteration?
Accuracy score regardless of estimator
The estimator’s score method
Macro F1 by default
Mean squared error
You run scores = cross_val_score(knn, X_trainval, y_trainval, cv=5). What is the role of the cv argument in this call?
Selects the evaluation metric
Sets the number of folds or the CV iterator
Chooses the classifier
Enables probability estimates
According to the default behavior described, when cv is an integer and the estimator is a classifier with binary or multiclass y, which CV strategy is used?
KFold
LeaveOneOut
StratifiedKFold
RepeatedKFold
Which parameter of cross_val_score allows you to choose a specific evaluation metric such as macro F1?
groups
params
scoring
n_jobs
In the function signature sklearn.model_selection.cross_val_score(estimator, X, y=None, *, groups=None, scoring=None, cv=None, n_jobs=None, verbose=0, params=None, pre_dispatch='2*n_jobs', error_score=nan), what do X and y represent?
Model hyperparameters and labels
Data features and target variable
Training indices and test indices
Group labels and scores
Which statement correctly describes the groups parameter in cross_val_score?
It sets class weights for imbalanced data.
It passes additional fit parameters to the estimator.
It provides group labels used when splitting with a Group CV instance.
It determines the number of parallel jobs.
If cv is an integer and the task is regression, which default CV splitter is used according to the material?
StratifiedKFold
KFold
GroupKFold
ShuffleSplit
Suppose you compute scores = cross_val_score(knn, X_trainval, y_trainval, cv=5) and obtain an array of five values. Which summary appropriately reports performance as shown in the example?
Report the max score only.
Print the median score without variability.
Print mean accuracy with the standard deviation of scores.
Report the training score of the final fit.
In the worked example, a loop evaluates KNeighborsClassifier over different n_neighbors using cross_val_score with cv=10. What is the purpose of taking np.mean(scores) for each i?
To select the best distance metric
To aggregate fold-wise scores into a single value for that n_neighbors
To average training losses
To compute macro-averaged precision
Which parameter controls parallel execution across folds in cross_val_score?
verbose
n_jobs
pre_dispatch
error_score
In the example, after selecting best_n_neighbors from cross-validation, the model is fit on X_train, y_train and evaluated on X_test, y_test. What is the rationale for this sequence?
Cross-validation directly optimizes test performance without refitting.
Refitting on the full training data with the selected hyperparameter allows unbiased evaluation on the held-out test set.
The test set is used to tune hyperparameters.
Cross-validation is only intended for regression, so classification requires refitting.
In scikit-learn, which iterator splits the dataset into k consecutive folds without stratification or grouping constraints?
KFold
StratifiedKFold
GroupKFold
TimeSeriesSplit
Which cross-validation strategy ensures that the same group is not represented in both training and testing sets within an iteration?
ShuffleSplit
GroupKFold
StratifiedKFold
TimeSeriesSplit
Consider binary classification with imbalanced classes. Which iterator is designed to preserve the percentage of samples for each class across folds?
KFold
StratifiedKFold
GroupShuffleSplit
ShuffleSplit
Which iterator is described as a random permutation cross-validator that generates random train/test splits without preserving class proportions or groups by default?
ShuffleSplit
KFold
StratifiedGroupKFold
TimeSeriesSplit
Which iterator is suited for temporal data by creating splits that respect ordering (training on earlier indices and testing on later indices)?
TimeSeriesSplit
GroupKFold
StratifiedShuffleSplit
KFold
A dataset has 100 input data points, 3 classes split unevenly across points, and 10 groups split evenly. Which iterator simultaneously enforces class stratification and prevents group overlap between train and test?
StratifiedKFold
GroupKFold
StratifiedGroupKFold
ShuffleSplit
According to the API shown, what does sklearn.model_selection.ShuffleSplit primarily do?
Split arrays or matrices into random train and test subsets
Create k consecutive equal-sized folds based on index order
Maintain class proportions exactly equal across all folds
Ensure no group appears in both train and test sets
The Iris dataset contains three species with 50 samples each. Which statement best describes their separability based on the provided summary?
All three species are linearly separable from each other.
One species is linearly separable from the other two, while those two are not linearly separable from each other.
None of the species is linearly separable from any other.
Exactly two species are linearly separable from each other and the third is inseparable from both.
According to the features listed for the Iris dataset, which variable is NOT among the four features used?
SepalLengthCm
PetalWidthCm
LeafAreaCm
SepalWidthCm
A code snippet shows using KFold with n_splits=3 on the Iris dataset and yields very low accuracy. Based on the section’s explanation, which scenario most likely causes this poor result?
Using too many features increases overfitting.
The dataset is sorted by class labels, so standard KFold can place entire classes in separate folds, making some test folds contain unseen classes.
The Iris dataset has missing values that KFold cannot handle.
KFold always performs worse than train/test split regardless of data ordering.
What is the primary purpose of StratifiedKFold as contrasted with standard KFold in the context discussed?
To reduce the number of folds needed for cross-validation.
To ensure each fold has class proportions that mirror the overall dataset, preventing folds that miss some classes.
To increase the training data size by duplicating samples.
To randomize feature order for each split.
When your dataset is highly imbalanced, why is StratifiedKFold recommended?
It oversamples the minority class within each fold to achieve perfect balance.
It guarantees that minority classes appear in each fold according to their overall frequency, reducing the chance that a class is missing from a fold.
It removes rare classes before splitting to stabilize accuracy.
It merges minority classes to simplify classification.
If the data are sorted by class and you apply standard (non-stratified) KFold, what accuracy outcome is highlighted in the material?
Accuracy will be optimal because classes are isolated.
Accuracy will be zero because some folds test on classes not present in their training data.
Accuracy will be unchanged because sorting has no effect.
Accuracy will be random and vary widely but remain positive.
Which statement about class frequencies under StratifiedKFold is correct according to the section?
Relative class frequencies in each fold are forced to be exactly equal across classes.
Relative class frequencies in each fold reflect the relative class frequencies in the entire dataset.
Class frequencies are ignored because StratifiedKFold only randomizes indices.
Class frequencies are matched only in the training parts, not in the test parts.
