I have an imbalanced dataset, I am balancing it using the SMOTE algorithm. After oversampling when I print the confusion matrix it showed me the following output:
Support: '0' 91 Support: '1' 209
I have a dataset of 1000 labels 1 occurs 700 times and label 0 occurs 300 times, I am using 0.3 for test data, but Why its showing me support 91 and 209?
Even If I do not apply the SMOTE algorithm then it is showing me 91 and 209 and after applying SMOTE it is the same.
Clarification
First, this is not a confusion matrix, this is a classification report. It regroups the metrics that can be calculated from a confusion matrix.
Smote purpose
Secondly, you apply
SMOTE
to your trainset only. Therefore, if you are following someone's code, they would have trained their model on the train data oversampled with SMOTE. However, the testing is done on the original data (which is logical).Your purpose of using SMOTE in your trainset is to improve its imbalance. Once the model has learned the supposedly
better
weights from the newlyoversampled
data, you proceed by testing on the test data you have split when you didtrain_test_split(X,y,test_size=0.3)
.Code