How to predict responses of new data from linear SVM model?
Hello, I am trying to calculate new predictions with trained linear SVM regression (4 input variables and 1 output).
from this equation, I tried:
x_new = [8.9 10.2 42.8 44.8]; % New input variables (4 variables)
supportVectors = Mdl.SupportVectors;
alpha = Mdl.Alpha;
bias = Mdl.Bias;
w = (alpha .* supportVectors)’;
prediction = (w .* x_new) + bias;
——————————————————————-
However, when I compare the results of the code below, there’s a different value:
prediction = Mdl.predict(x_new);
If there is a code that calculates the output value when a new observation comes in through the trained SVM, please help me.Hello, I am trying to calculate new predictions with trained linear SVM regression (4 input variables and 1 output).
from this equation, I tried:
x_new = [8.9 10.2 42.8 44.8]; % New input variables (4 variables)
supportVectors = Mdl.SupportVectors;
alpha = Mdl.Alpha;
bias = Mdl.Bias;
w = (alpha .* supportVectors)’;
prediction = (w .* x_new) + bias;
——————————————————————-
However, when I compare the results of the code below, there’s a different value:
prediction = Mdl.predict(x_new);
If there is a code that calculates the output value when a new observation comes in through the trained SVM, please help me. Hello, I am trying to calculate new predictions with trained linear SVM regression (4 input variables and 1 output).
from this equation, I tried:
x_new = [8.9 10.2 42.8 44.8]; % New input variables (4 variables)
supportVectors = Mdl.SupportVectors;
alpha = Mdl.Alpha;
bias = Mdl.Bias;
w = (alpha .* supportVectors)’;
prediction = (w .* x_new) + bias;
——————————————————————-
However, when I compare the results of the code below, there’s a different value:
prediction = Mdl.predict(x_new);
If there is a code that calculates the output value when a new observation comes in through the trained SVM, please help me. linear svm, svm MATLAB Answers — New Questions