In Weka, SpreadSubsample or ClassBalancer cannot handle numeric class. Then, how to make an imbalanced dataset with numeric class ( a large portion of the instances are concentrated in a narrow class value range) more balanced?
I am not familiar with Weka, but please review this answer: https://www.researchgate.net/post/How_do_I_handle_imbalanced_classes_in_a_dataset. In short, either you undersample from the majority classes to match a certain size, or you oversample the minority classes to match that size. Techniques such as SMOTE and KNN are helpful.
To correct your claim, ClassBalancer can handle numeric class. Another option you can consider is converting this numeric class into a nominal one and then you'd be able to use SMOTE or SpreadSubsample. To be on the safe side, apply the ClassBalancer through "FilteredClassifier", in which its base classifier can be "LinearRegression", for instance.
Note that ClassBalancer can handle the following class types:
Thank you all, Samer, Faris, and Khalid, for your tips.
Yes, converting the numeric class to a nominal one should be a good way to deal with the issue.
When I applied ClassBalancer to the numeric class (Weka 3.8), I got the following error message: “Problem filtering instances: 1”. I tried ClassBalancer on another simple dataset (with 159 instances) with numeric class, and got the error message “ Problem filtering instances: 13950”. What could be the reason for those error messages?