Support Vectors are wrong in my SVR model

1 回表示 (過去 30 日間)
hu yang
hu yang 2016 年 8 月 28 日
回答済み: Jo 2023 年 10 月 26 日
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;

回答 (1 件)

Jo
Jo 2023 年 10 月 26 日
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.

カテゴリ

Help Center および File ExchangeSupport Vector Machine Regression についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by