CommencerCommencer gratuitement

Running a model using ranges

You have just finished creating a list of hyperparameters and ranges to use when tuning a predictive model for an assignment. You have used max_depth, min_samples_split, and max_features as your range variable names.

Cet exercice fait partie du cours

Model Validation in Python

Afficher le cours

Instructions

  • Randomly select a max_depth, min_samples_split, and max_features using your range variables.
  • Print out all of the parameters for rfr to see which values were randomly selected.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

from sklearn.ensemble import RandomForestRegressor

# Fill in rfr using your variables
rfr = RandomForestRegressor(
    n_estimators=100,
    max_depth=random.____(____),
    min_samples_split=random.____(____),
    max_features=random.____(____))

# Print out the parameters
print(rfr.____)
Modifier et exécuter le code