ComenzarEmpieza gratis

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 ejercicio forma parte del curso

Model Validation in Python

Ver curso

Instrucciones del ejercicio

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

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

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 y ejecutar código