Does anyone please know how to solve this issue; Thank you!
ValueError: y_true and y_pred contain different number of classes 8, 11. Please provide the true labels explicitly through the labels argument. Classes found in y_true: ['Bills & Fees' 'Data & WiFi' 'Going out' 'Groceries' 'Health' 'Loan Repayment' 'Shopping' 'Transport & Fuel']
The problem is your train and validation set.
Okay! What is specifically wrong with it, please? @Raheem_Nasirudeen. I can't seem to understand the issue
Use model.predict_proba(test) instead of d normal predict function
That is what I am using; predict_proba
I think, because number of classes (for education, for example) is very low, you don't get samples in your validation set with some labels - in your "y_true" there are not 'education', 'rent/mortgage' at all as I see. Use "stratify" option in your train/test split.
But... Still strange, that you have 11 classes in train set - should be 13. check your lebel encoding as well
Yeah, we have an imbalanced distribution here
Thank you @serg132003. I will try implementing stratify