1. Learn
  2. /
  3. Courses
  4. /
  5. Hyperparameter Tuning in Python

Exercise

Exploring Random Forest Hyperparameters

Understanding what hyperparameters are available and the impact of different hyperparameters is a core skill for any data scientist. As models become more complex, there are many different settings you can set, but only some will have a large impact on your model.

You will now assess an existing random forest model (it has some bad choices for hyperparameters!) and then make better choices for a new random forest model and assess its performance.

You will have available:

  • X_train, X_test, y_train, y_test DataFrames
  • An existing pre-trained random forest estimator, rf_clf_old
  • The predictions of the existing random forest estimator on the test set, rf_old_predictions

Instructions 1/3

undefined XP
    1
    2
    3
  • Print out the hyperparameters of the existing random forest classifier by printing the estimator and then create a confusion matrix and accuracy score from it. The test set y_test and the old predictions rf_old_predictions will be quite useful!