Data Analytics Boot Camp - Challenge 17
In this project, we're employing different techniques to train and evaluate models with unbalanced classes. Using imbalanced-learn and scikit-learn libraries to build and evaluate models using resampling.
Using the credit card credit dataset, we’ll oversample the data using the RandomOverSampler and SMOTE algorithms, and undersample the data using the ClusterCentroids algorithm. Then, we’ll use a combinatorial approach of over- and undersampling using the SMOTEENN algorithm. Next, we’ll compare two new machine learning models that reduce bias, BalancedRandomForestClassifier and EasyEnsembleClassifier, to predict credit risk. Once we’re done, we’ll evaluate the performance of these models and make a written recommendation on whether they should be used to predict credit risk.
Below are my results after running the code. Please note that HR refers to High Risk and LR to Low Risk.
- RandomOverSampler
- Balanced accuracy score:
0.65average of recall for each class - Precision: HR=
0.01LR=1model is reliable at predicting LR positives but not HR positives - Recall: HR=
0.69LR=0.60model is more reliable at predicting HR positives than LR positives
- SMOTE
- Balanced accuracy score:
0.66average of recall for each class - Precision: HR=
0.01LR=1model is reliable at predicting LR positives but not HR positives - Recall: HR=
0.63LR=0.69model is more reliable at predicting LR positives than HR positives
- ClusterCentroids
- Balanced accuracy score:
0.54average of recall for each class - Precision: HR=
0.01LR=1model is reliable at predicting LR positives but not HR positives - Recall: HR=
0.69LR=0.40model is more reliable at predicting HR positives than LR positives
- SMOTEENN
- Balanced accuracy score:
0.54average of recall for each class - Precision: HR=
0.01LR=1model is reliable at predicting LR positives but not HR positives - Recall: HR=
0.72LR=0.57model is more reliable at predicting HR positives than LR positives
- BalancedRandomForestClassifier
- Balanced accuracy score:
0.79average of recall for each class - Precision: HR=
0.03LR=1model is reliable at predicting LR positives but not HR positives - Recall: HR=
0.70LR=0.87model is more reliable at predicting LR positives than HR positives
- EasyEnsembleClassifier
- Balanced accuracy score:
0.93average of recall for each class - Precision: HR=
0.09LR=1model is reliable at predicting LR positives but not HR positives - Recall: HR=
0.92LR=0.94model is more reliable at predicting LR positives than HR positives
Based on the 6 models above, I would recommend using the Easy Ensemble Classifier because of the highest recall scores for both High Risk and Low Risk. High recall (sensitivity) means the model is better at predicting all high risk applications. Higher recall score in this case is more important than the precision score.






