'How to access epsilon value in nu-SVR model?
I'm using the nu-SVR implementation from sklearn (https://scikit-learn.org/stable/modules/generated/sklearn.svm.NuSVR.html) to build a regression model for a set of data (X,Y). The nu-SVR implementation substitutes the "epsilon" parameter on the traditional SVR by a new parameter that allows you to control the number of support vectors (see 2.5 in https://www.csie.ntu.edu.tw/~cjlin/papers/libsvm.pdf). In this case, epsilon is then part of the optimization solution.
I am interested in accessing the value of epsilon that results when I fit the model on the data. I can see it after fit(X,y) is done if I turn on verbose:
regr = make_pipeline(StandardScaler(), NuSVR(C=1.0, nu=0.1, verbose=True))
regr.fit(X, y)
And I obtain printed on screen:
optimization finished, #iter = 51015
epsilon = 0.000387
obj = -4831.702255, rho = -2.189595
nSV = 9961, nBSV = 0
How can I programmatically access this value of epsilon
obtained in the SVR object? (I need to use it further along in the code)
I tried accessing the attribute .epsilon
in the NuSVR
object after the fitting finished, but it still shows a value of 0.0.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|