ComeçarComece de graça

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.

Este exercício faz parte do curso

Model Validation in Python

Ver curso

Instruções do exercício

  • 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.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

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.____)
Editar e executar o código