Borrar filtros
Borrar filtros

Support Vectors are wrong in my SVR model

1 visualización (últimos 30 días)
hu yang
hu yang el 28 de Ag. de 2016
Respondida: Jo el 26 de Oct. de 2023
I trained an SVR model by fitrsvm. Since I need to get all support vector I have checked the model ouput. Surprisingly, the mdl.SupportVectors have nothing in common with my input mdl.X. Can anyone tell me why.
Below is my code. sorry the csv files are too larged to be uploaded.
input = csvread('sample.csv');
target = csvread('target.csv');
Y = log(target(2,:)+1)';
%Y = log(target(2,:)+1)';
%turbidity = log(target(1,:)+1);
turbidity = target(1,:);
mainComp = 15;
s = load('eigenVector.mat','s');
s = s.s;
v = load('singularValue.mat','v');
v = v.v;
a = s'*input;
b = inv(v(1:mainComp,1:mainComp))*a(1:mainComp,:);
X = [b;log(turbidity+1)];
mdl = fitrsvm(X',Y,'Standardize',true,'KernelFunction','polynomial','KernelScale','auto','OutlierFraction',0.05);
save mySVMMDL mdl;
yfit = exp(predict(mdl,X'))-1;

Respuestas (1)

Jo
Jo el 26 de Oct. de 2023
Hello,
I know this post is old but maybe my answer can help someone that may have the same question ?
The data stored in "mdl.SupportVectors" are preprocessed data. As you have set the option 'standardized','true', these data are standardized. So you need to standardized manually "Mdl.X" to be able to compare both matrices.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by