Nu is infeasible

情到浓时终转凉″ 提交于 2019-12-10 14:00:18

问题


I am using the NuSVC class in sklearn. After trying to instantiate an NuSVC object as follows:

self.classifier = OneVsRestClassifier(NuSVC())

I found that I repeatedly get a 'specified nu is infeasible' error. I tried varying the 'nu' parameter from 0.1 all the way to 1. (in 0.1 increments), but I keep getting the same error. I am really unsure how to interpret this message, and how to go about resolving it? I figured that if I set the nu to 1., it would work because nu represents an upper bound on the fraction of training errors which I believe should always be tenable. What could be causing this?

Thanks for the help!


回答1:


For completeness, from the documentation: Nu-SVM is a constrained formulation of SVM (equivalent with the original up to reparametrization) which poses a hard bound on the allowed misclassification. If this bound cannot by satisfied, then the associated convex optimization problem becomes infeasible.

From this standpoint the first thing you have to investigate is how much training error you really can expect, and maybe revise your assumptions. Search over a grid of C values for a standard SVM to check that.

NuSVC should work with some values strictly less than 1, though. According to your description, you have tried 0.9 -- start adding 9s, ie .99, .999. If it doesn't work at some point, then there has to be another problem somewhere.



来源:https://stackoverflow.com/questions/26987248/nu-is-infeasible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!