【MATLAB第88期】基于MATLAB的6种神经网络(ANN、FFNN、CFNN、RNN、GRNN、PNN)多分类预测模型对比含交叉验证
前言
本文介绍六种类型的神经网络分类预测模型
1.模型选择
-
前馈神经网络 (FFNN)
-
人工神经网络 (ANN)
-
级联前向神经网络 (CFNN)
-
循环神经网络 (RNN)
-
广义回归神经网络 (GRNN)
-
概率神经网络 (PNN)
2.数据情况
357行样本,12输入,1输出,4分类。
无交叉验证情况,默认70%训练,30%测试。
clike
%% 导入数据
res = xlsread('数据集C.xlsx');
feat=res(:,1:end-1);
label=res(:,end);
T_sim1 = []; T_sim2 = [];
ytest2 = [];
ytrain2 = [];
ho=0.3;%测试集的比例
3.程序使用
更改type类型即可自动筛选模型并运行。
clike
switch type
case 'NN' ;
case 'FFNN' ;
case 'CFNN' ;
case 'RNN' ;
case 'GRNN' ;
case 'PNN' ;
end
4.通用参数
Hidden_size = [10,10];%隐含层神经元
Max_epochs = 50; %最大训练次数
tf = 1; %2为交叉验证, 1无交叉验证。
一、前馈神经网络 (FFNN)
1、无交叉验证
clike
tf = 1; %2为交叉验证, 1无交叉验证。
kfold = 1; %K折

2、有交叉验证(3折为例)
clike
tf = 2; %2为交叉验证, 1无交叉验证。
kfold = 3; %K折

二、级联前向神经网络 (CFNN)
1、无交叉验证
clike
tf = 1; %2为交叉验证, 1无交叉验证。
kfold = 1; %K折

2、有交叉验证(3折为例)
clike
tf = 2; %2为交叉验证, 1无交叉验证。
kfold = 3; %K折

三、广义回归神经网络 (GRNN)
1、无交叉验证
clike
tf = 1; %2为交叉验证, 1无交叉验证。
kfold = 1; %K折
num_spread=1;

2、有交叉验证(3折为例)
clike
tf = 2; %2为交叉验证, 1无交叉验证。
kfold = 3; %K折
num_spread=1;

四、人工神经网络 (NN)
1、无交叉验证
clike
tf = 1; %2为交叉验证, 1无交叉验证。
kfold = 1; %K折

2、有交叉验证(3折为例)
clike
tf = 2; %2为交叉验证, 1无交叉验证。
kfold = 3; %K折

五、循环神经网络 (RNN)
1、无交叉验证
clike
tf = 1; %2为交叉验证, 1无交叉验证。
kfold = 1; %K折

2、有交叉验证(3折为例)
clike
tf = 2; %2为交叉验证, 1无交叉验证。
kfold = 3; %K折

六、循环神经网络 (RNN)
1、无交叉验证
clike
tf = 1; %2为交叉验证, 1无交叉验证。
kfold = 1; %K折
num_spread = 100;

2、有交叉验证(3折为例)
clike
tf = 2; %2为交叉验证, 1无交叉验证。
kfold = 3; %K折
num_spread = 100;

七、代码获取
1.阅读首页置顶文章
2.关注CSDN
3.根据自动回复消息,回复"88期"以及相应指令,即可获取对应下载方式。