Problem 3: Compare Grid Search and Random Search Results
Easypython
Problem Description
Write a Python program that runs both Grid Search and Random Search on the same dataset and hyperparameter space, comparing their best scores and the time each approach conceptually would need (based on number of combinations tested).
Input
A labeled dataset and a hyperparameter search space.
Output
Best scores from both approaches, and the number of combinations each tested.
Constraints
- None specific.
Example Input
text(A labeled dataset with a moderate search space)
Example Output
textGrid Search — Best score: 0.88, Combinations tested: 12 Random Search — Best score: 0.86, Combinations tested: 5
Concepts Covered
GridSearchCV, RandomizedSearchCV, comparison.