%% 数据归一化
[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);
%% 转置以适应模型
p_train = p_train'; p_test = p_test';
t_train = t_train'; t_test = t_test';
%% 创建网络
k = 7; % 保留成分个数
[theta, ch0] = my_pls(p_train, t_train, k);
%% 仿真测试
t_sim1 = sim_pls(p_train, theta, ch0);
t_sim2 = sim_pls(p_test , theta, ch0);
%% 数据反归一化
T_sim1 = mapminmax('reverse', t_sim
, 相关下载链接:
https://download.csdn.net/download/qq_28543131/88495312?utm_source=bbsseo