GridSearchCV(scoring='f1') is used with a classifier and cv left at its default. Which splitter is applied?
Correct answer
A. StratifiedKFold with 5 splits, which preserves each class ratio inside every fold
17 views
A. StratifiedKFold with 5 splits, which preserves each class ratio inside every fold
17 views
GridSearchCV inherits check_cv, which returns StratifiedKFold(5) for classifiers and KFold(5) for regressors when cv is an integer. Stratification keeps rare classes represented in every fold, which stabilises f1 and recall estimates. Passing an explicit splitter, or a grouping-aware one such as GroupKFold, prevents leakage when rows are not independent.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is A? Ask here and get an explanation.