输出结果
更新中
代码设计
load water_data.mat
attributes = mapminmax(attributes);
P_train = attributes(:,1:35);
T_train = classes(:,1:35);
P_test = attributes(:,36:end);
T_test = classes(:,36:end);
net = newsom(P_train,[4 4]);
net.trainParam.epochs = 200;
net = train(net,P_train);
t_sim_sofm_1 = sim(net,P_train);
T_sim_sofm_1 = vec2ind(t_sim_sofm_1);
t_sim_sofm_2 = sim(net,P_test);
T_sim_sofm_2 = vec2ind(t_sim_sofm_2);
result_sofm_1 = [T_train' T_sim_sofm_1']
result_sofm_2 = [T_test' T_sim_sofm_2']