Session Ready
Exercise

OOB Score vs Test Set Score

Now that you instantiated bc, you will fit it to the training set and evaluate its test set and OOB accuracies.

The dataset is processed for you and split into 80% train and 20% test. The feature matrices X_train and X_test, as well as the arrays of labels y_train and y_test are available in your workspace. In addition, we have also loaded the classifier bc instantiated in the previous exercise and the function accuracy_score() from sklearn.metrics.

Instructions
100 XP
  • Fit bc to the training set and predict the test set labels and assign the results to y_pred.

  • Evaluate the test set accuracy acc_test by calling accuracy_score.

  • Evaluate bc's OOB accuracy acc_oob by extracting the attribute oob_score_ from bc.