QuestionQ74

VerifiedModel Development

A data scientist is tuning the hyperparameters of a RandomForestClassifier model. They will use scikit-learn's GridSearchCV function with these parameters:

  • cross validation = 5
  • param_grid has 3 parameters to consider:
    • max_depth: [5, 10, 15, 20]
    • max_features: ['auto', 'sqrt', 'log2']
    • n_estimators: [200, 500]

How many models will be trained in total?

Explanation

GridSearchCV exhaustively evaluates the Cartesian product of parameter values. The grid contains 4 × 3 × 2 = 24 parameter combinations, and 5-fold cross-validation fits each combination on five folds, for 24 × 5 = 120 model fits.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!