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.
Latihan ini adalah bagian dari kursus
Model Validation in Python
Petunjuk latihan
- Randomly select a
max_depth,min_samples_split, andmax_featuresusing your range variables. - Print out all of the parameters for
rfrto see which values were randomly selected.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
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.____)