matlab notequal,MATLAB出现 number of datapoints not equal to number of targetpoint

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:52   6104   0

R=[134.972961100000,15989.3046000000,1492597.77800000,3.40790271200000;

269.608102000000,31907.3332400000,5947109.56900000,3.40790271200000;

672.135466000000,79297.5187200000,36797224.2400000,17.0307146700000;

939.537699500000,110609.085900000,71681393.9300000,23.8540848400000;

295.777975500000,35504.8105700000,7263170.77000000,7.36954974600000;

481.514152600000,57723.9934500000,19212865.0500000,12.0115579000000;

982.603474600000,117353.154100000,79579747.3000000,24.5968228800000;

170.905795000000,20839.0898200000,2465657.65200000,4.19338087700000;

320.203003500000,39007.7869400000,8643798.98600000,7.86322989100000;

511.878867400000,62278.7678400000,22049524.5300000,12.5849698200000;

745.764725400000,90587.3586700000,46693775.3900000,18.3624642100000;

187.217091700000,23177.9398300000,3006232.60900000,4.52562385900000;

342.999747900000,42427.1437500000,10078084.3400000,8.29800341100000;

540.061174800000,66721.0961100000,24941406.8700000,13.0798579400000;

1057.35455900000,130177.369800000,95133400.9600000,25.6873477800000];

X=R';

D=[0.100000000000000,0.100000000000000;

0.100000000000000,0.150000000000000;

0.100000000000000,0.250000000000000;

0.100000000000000,0.300000000000000;

0.150000000000000,0.150000000000000;

0.150000000000000,0.200000000000000;

0.150000000000000,0.300000000000000;

0.200000000000000,0.100000000000000;

0.200000000000000,0.150000000000000;

0.200000000000000,0.200000000000000;

0.200000000000000,0.250000000000000;

0.250000000000000,0.100000000000000;

0.250000000000000,0.150000000000000;

0.250000000000000,0.200000000000000;

0.250000000000000,0.300000000000000];

Y=D';

R_test=[448.740003800000,53034.5057300000,16442940.3700000,11.3532774800000;

153.508237000000,18444.3821400000,1959051.78900000,3.82173486600000;

710.527095000000,85033.9431700000,41733485.6700000,17.7524389600000;

1021.66656700000,123855.291800000,87386886.7200000,25.2005793400000;

778.241067800000,95996.5073900000,51676861.5700000,18.8748137000000];

Xt=R_test';

D_test=[0.100000000000000,0.200000000000000;

0.150000000000000,0.100000000000000;

0.150000000000000,0.250000000000000;

0.200000000000000,0.300000000000000;

0.250000000000000,0.250000000000000];

Yt=D_test';

type = 'function estimation';

kernel = 'RBF_kernel';

gam = [10]; %正则化参数

sig2 = [32]; % 内核参数'

model = initlssvm(X,Y,type,gam,sig2,kernel); % 模型初始化

%---------------------------------------------------

% 训练与测试

model = trainlssvm(model); % 训练

Yp = simlssvm(model,Xt); % 回归

%---------------------------------------------------

% 结果作图

plot(1:length(Yt),Yt,'r+:',1:length(Yp),Yp,'bo:')

title('+为真实值,o为预测值')

错误使用 initlssvm (line 55)

number of datapoints not equal to number of targetpoints...

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP