I am trying to predict the appearance count of a particular item using Neural Network.My data has severe imbalance i.e 90% of data contains zero as output, remaining values ranges from 1 to 5. I am training a neural network with item features and week number of year.Whenever I run the neural network and **predict for the training data the sum of all predicted counts are equal to the sum of observed counts but the individual counts are not even getting close.I tried with both RMSE and MAE as error metrics.**I am not sure about this is correct, any help would be great
1 Answer
The problem with Machine Learning classification models is that they assume the input data have almost same number of data for each class. I had a dataset having classes in the ratio 95% and 5%. So, of course when I did prediction, I got 100% accuracy (which you can never get on real world data). To remove this problem, I used under-sampling of data (took approx same number of training data of majority class as was minority class). Of course this is not the ideal method, but it worked for me.
You can do the same with your data. I suggest you to look at this- https://www.analyticsvidhya.com/blog/2017/03/imbalanced-classification-problem/
https://elitedatascience.com/imbalanced-classes
Many links will give you the following methods to tackle this problem - Over-sampling of minority class, under-sampling of majority class, using tree based methods etc. Its up to you to decide, take the one which gives you better output.
-
$\begingroup$ You are explaining in a Classification perspective but here I am performing a regression $\endgroup$ Commented Dec 5, 2017 at 12:39
-
$\begingroup$ Then why are you saying there is a class imbalance ? Class imbalance means you want to do classification. If your problem is of regression then it has nothing to do with imbalance. @RAVITEJAM $\endgroup$ Commented Dec 5, 2017 at 13:27
-
$\begingroup$ Sorry I just mentioned in a wrong way.But problem is in regression only $\endgroup$ Commented Dec 6, 2017 at 4:16
-
$\begingroup$ Is your data a time series data? Is it dependent on time like week or something else? $\endgroup$ Commented Dec 6, 2017 at 8:28
-
$\begingroup$ Yes, it is a data observed over time.It depends on week $\endgroup$ Commented Dec 6, 2017 at 15:53