Classification prediction | MATLAB implements DBN-SVM deep belief network combined with support vector machine multi-input classification prediction

Classification prediction | MATLAB implements DBN-SVM deep belief network combined with support vector machine multi-input classification prediction

predictive effect

insert image description here
insert image description here
insert image description here
insert image description here

basic introduction

1. Classification prediction | MATLAB implements DBN-SVM deep belief network combined with support vector machine multi-input classification prediction
2. Code description: Matlab version 2021 and above are required.

programming

  • Complete program and data acquisition method 1: program exchange of equal value;
  • Complete program and data acquisition method 2: private message bloggers reply to MATLAB to achieve DBN-SVM deep belief network combined with support vector machine multi-input classification prediction acquisition.
%%  划分训练集和测试集
P_train = res(1: num_train_s, 1: f_)';
T_train = res(1: num_train_s, f_ + 1: end)';
M = size(P_train, 2);

P_test = res(num_train_s + 1: end, 1: f_)';
T_test = res(num_train_s + 1: end, f_ + 1: end)';
N = size(P_test, 2);

%%  数据归一化
[p_train, ps_input] = mapminmax(P_train, 0, 1);
p_test = mapminmax('apply', P_test, ps_input);

[t_train, ps_output] = mapminmax(T_train, 0, 1);
t_test = mapminmax('apply', T_test, ps_output);
dbn = dbnsetup(dbn, p_train, opts);     % 建立模型
dbn = dbntrain(dbn, p_train, opts);     % 训练模型
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%%  训练权重移植,添加输出层
nn = dbnunfoldtonn(dbn, num_class);

%%  反向调整网络
opts.numepochs          = 576;  % 反向微调次数
opts.batchsize          = M;            % 每次反向微调样本数 需满足:(M / batchsize = 整数)

nn.activation_function  = 'sigm';       % 激活函数
nn.learningRate         = 2.9189;       % 学习率
nn.momentum             = 0.5;          % 动量参数
nn.scaling_learningRate = 1;            % 学习率的比例因子

[nn, loss, accu] = nntrain(nn, p_train, t_train, opts);  % 训练
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
%%  仿真预测 
T_sim1 = nnpredict(nn, p_train); 
T_sim2 = nnpredict(nn, p_test );

%%  性能评价
error1 = sum((T_sim1' == T_train)) / M * 100 ;
error2 = sum((T_sim2' == T_test )) / N * 100 ;
https://blog.csdn.net/kjm13182345320/article/details/131174983
版权声明:本文为CSDN博主「机器学习之心」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/kjm13182345320/article/details/130462492


References

[1] https://blog.csdn.net/kjm13182345320/article/details/129679476?spm=1001.2014.3001.5501
[2] https://blog.csdn.net/kjm13182345320/article/details/129659229?spm=1001.2014.3001.5501
[3] https://blog.csdn.net/kjm13182345320/article/details/129653829?spm=1001.2014.3001.5501

Guess you like

Origin blog.csdn.net/kjm13182345320/article/details/132359371