In the Support Vector Regression, where can i see or identify the solved function?

3 次查看(过去 30 天)
I want to plot the solved function, linear or nonlinear, so it would be great if someone can help me out where i can find this. And another question: In SVM Regression, how can i get information about the goodness of the fit, like the R-squared value?

回答(1 个)

Darshan Ramakant Bhat
According to my understanding you are trying to plot the learned function from the svm regression. You can do this by accessing the parameters of the returned model.You can plot maximum upto 3D. A pseudo code can like follows.
Mdl = fitrsvm(X,Y);
Y_response = (1/(mdl.KernelParameters.Scale))*X*mdl.Beta+mdl.Bias;
plot(X,Y_response) %use appropriate plot function 2-D or 3-D
To get the regression value you can use the loss() function. I think following documentation would help you
Regards
Darshan Bhat
  1 个评论
Sebastian Kaufmann
Sebastian Kaufmann 2017-3-10
Thank you for your great help, this code works perfectly for plotting a linear Regression, but when i want to try a nonlinear Kernel like this:
SVMR = fitrsvm(X,y,'KernelFunction','polynomial');
Y_response =(1/(SVMR.KernelParameters.Scale))*X*SVMR.Beta+SVMR.Bias;
i am getting the following error: "Error using * Inner matrix dimensions must agree."
Can you maybe help me with this? Would be so kind.
And the loss function is the only way to get a value of the goodness of the fit?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Support Vector Machine Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by