楼主: 小未名子
2413 1

[问答] 出现错误using SVMcgForRegress Too many output arguments.怎么解决 [推广有奖]

  • 0关注
  • 0粉丝

高中生

10%

还不是VIP/贵宾

-

威望
0
论坛币
70 个
通用积分
0.1514
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
429 点
帖子
16
精华
0
在线时间
24 小时
注册时间
2015-7-19
最后登录
2017-3-8

楼主
小未名子 学生认证  发表于 2016-3-3 07:52:54 |AI写论文
20论坛币
%数据归一化
Xdata=mapminmax(x')';   % 按照行归一化[-1 1]
Ydata=mapminmax(y')';
[M,N]=size(x);
X_train=Xdata(1:round(3*M/4),:);X_test=Xdata(round(3*M/4)+1:M,:);
Y_train=Ydata(1:round(3*M/4),:);Y_test=Ydata(round(3*M/4)+1:M,:);
%参数寻优
[mse,bestc,bestg] = SVMcgForRegress(Y_train,X_train);    % bestc=3.0314   bestg=0.0118
% 回归模型
model = svmtrain(Y_train,X_train,'-s 3 -t 2 -c 3.0314 -g 0.0118 -p 0.01');
% 模型预测
[py,mse] = svmpredict(Y_test,X_test,model);  
% 返归一化
miny=min(y);maxy=max(y);
py=postmnmx(py,miny,maxy);
% 显示预测结果
Y_test=y(round(3*M/4)+1:M,:);  % 原始数据
plot(1:length(py),Y_test,'o');
hold on
plot(1:length(py),py); % 预测数据
hold off
Y_test=y(round(3*M/4)+1:M,:);  % 原始数据
plot(1:length(py),Y_test,'o');
hold on
plot(1:length(py),py); % 预测数据
hold off

Y_test=y(round(3*M/4)+1:M,:);  % 原始数据
plot(1:length(py),Y_test,'o');
hold on
plot(1:length(py),py); % 预测数据
hold off
数据在附件里


y.docx
下载链接: https://bbs.pinggu.org/a-1983975.html

12.63 KB

数据

x.docx

29.58 KB

数据

关键词:Arguments argument regress output Using Error 模型

沙发
matlab-007 发表于 2016-8-28 20:56:15
使用svmcgforregress太多的输出参数

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 04:33