Home > Back-end >  The couple consult LSSVM algorithm, error importing data,
The couple consult LSSVM algorithm, error importing data,

Time:04-14

Newcomer consult, LSSVM algorithm, import the data error, I am according to example changes only sample matrix, then appear this error,
Error using initlssvm (line 55)
Number of datapoints not equal to number of targetpoints...
 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';
The kernel='RBF_kernel';
Gam=[10];
% regularization parameterSig2=[32]; % the kernel parameters'
Model=initlssvm (X, Y, type, gam, sig2, kernel); % model initialization
% -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

% training and testingThe model=trainlssvm (model);
% trainingYp=simlssvm (model, Xt); % return
% -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
% result drawing
Plot (1: length (Yt), Yt, 'r + :' 1: length (Yp), Yp, 'bo:)
The title (' + for the real value, o for prediction)

Error using initlssvm (line 55)
Number of datapoints not equal to number of targetpoints...

CodePudding user response:

The building Lord solved? Excuse me, I also just started to learn, also have the problem, how to solve ah, ask