In many situations in machine learning, one type of error may be more important than another. For example, in a multilayered defense system, it may make sense to require a layer to have a low false alarm (low false positive) rate, at the cost of some detection rate. In this section, we provide a recipe for ensuring that the FPR does not exceed a desired limit by using thresholding.
Handling type I and type II errors
Getting ready
Preparation for this recipe consists of installing scikit-learn and xgboost in pip. The instructions are as follows:
pip install sklearn xgboost