MLS-C01 Question 244
Single answerYou are building a machine learning model to predict customer churn using an imbalanced dataset. To ensure the model generalizes well, you decide to perform cross-validation. Which of the following approaches would be most appropriate for this scenario?
- A
Perform K-Fold cross-validation without any adjustments for class imbalance.
- B
Use Stratified K-Fold cross-validation to maintain the class distribution in each fold.
- C
Perform Leave-One-Out cross-validation to maximize the use of the dataset.
- D
Randomly split the dataset into training and validation sets multiple times without considering class balance.
Show answer and explanation
Correct answer: B
Explanation
Stratified K-Fold cross-validation is the most appropriate approach for imbalanced datasets because it ensures that each fold has a similar class distribution to the original dataset. This helps the model generalize better and provides a more reliable evaluation of its performance.
- A. Incorrect.
Performing K-Fold cross-validation without adjustments for class imbalance could lead to folds with uneven class distributions, especially in imbalanced datasets, resulting in biased evaluation or training.
- B. Correct.
Stratified K-Fold cross-validation maintains the class distribution in each fold, ensuring that both the training and validation sets have a representative proportion of each class. This is particularly useful for imbalanced datasets.
- C. Incorrect.
Leave-One-Out cross-validation uses a single data point for validation and all others for training, which can be computationally expensive and does not address the issue of class imbalance.
- D. Incorrect.
Randomly splitting the dataset into training and validation sets multiple times without considering class balance may result in unrepresentative splits, leading to biased model evaluation.