Due to class imbalance, we will need to resample our training data or apply different techniques to get better classification results. Thus, we are going to rely on theimbalanced-learnlibrary here. The project was started in 2014 by Fernando Nogueira. It now offers multiple resampling data techniques, as well as metrics for evaluating imbalanced classification problems. The library's interface is compatible with scikit-learn.
You can download the library via pip by running the following command in your Terminal:
pip install -U imbalanced-learn
Now, you can import and use its different modules in your code, as we will see in the following sections. One of the metrics provided by the library is the geometric mean score. InChapter 8, Ensembles – When One Model is Not Enough, we learned about the true positive rate(TPR),or sensitivity, and the false positive rate (FPR), and we used them...