Session Ready
Exercise

A more complex bagging model

Having explored the semi-conductor data, let's now build a bagging classifier to predict the 'Pass/Fail' label given the input features.

The preprocessed dataset is available in your workspace as uci_secom, and training and test sets have been created for you.

As the target has a high class imbalance, use a "balanced" logistic regression as the base estimator here.

Instructions
100 XP
  • Instantiate a balanced logistic regression to use as the base classifier by specifying the parameter class_weight = 'balanced'.
  • Build a bagging classifier using the logistic regression as the base estimator, including the out-of-bag score, and using the maximum number of features as 10.
  • Print the out-of-bag score to compare to the accuracy.