I have a binary classification problem and I'm working with an unbalanced dataset. The count for each class in the training set looks like:
Training set:
Class 0: 29 cases
Class 1: 6246 cases
Test set:
Class 0: 2678 cases
Class 1: 12 cases
I applied the under-sampling technique and now there are for the training set:
Class 0: 29 cases
Class 1: 29 cases
After working with the Decision Trees algorithm, these are the obtained results:
Accuracy: 98.85%
Sensitivity: 0.00%
Specifity: 99.55%
The confusion Matrix of the training set:
[[ 7 5]
[ 1446 1232]]
The confusion Matrix of the test set:
[[ 0 12]
[ 19 2659]]
How I should fix this problem? The train_test_split proportion is 0.3 I should decrease it?
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=101, stratify=y)