Get negative predicted value in Support Vector Regresion (SVR)

I am doing Covid-19 cases prediction using SVR, and getting negative values, while there should be no number of Covid-9 cases negative. Feature input that I was used is mobility factor (where have negative data) and daily cases of Covid-19. Kernel that I used is RBF kernel. Can anyone explain why I am getting negative values? are the independent variable (mobility) that I used influence that?

Topic svr prediction regression svm

Category Data Science


It's frequent in regression tasks that for some instances, the predicted value is out of bounds of the theoretical range, sometimes in a way which is semantically meaningless for the task.

This is due to the regression method. For example in linear regression, some of the features may have a negative coefficient, and if this feature happens to have a very high value in the test data, this could result in a negative target value. Generally this happens with instances which strongly differ from the instances in the training set. If this happens with a lot of instances, it's likely that the training set is not representative enough, i.e. the model is overfit. It can especially happen if there are many features with high variations and/or bad predictors for the target (i.e. low correlation).

Assuming that only a few instances get predicted with an meaningless value this way, it's common to simply post-process the values, for example change every negative prediction to zero. This depends on the task of course.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.