50 likes | 201 Views
KDD CUP 2007. 機械系碩一丁組 M9603416 吳韋霆. 程式碼. clear all load transfer.txt; load tran.txt; transfer(:,[1 2])=[]; Targetset=transfer; [r_tran, c_tran]=size(tran); Dataset=tran; ind_train=1:3:(r_tran); ind_val=2:3:(r_tran); ind_test=3:3:(r_tran);. 程式碼.
E N D
KDD CUP 2007 機械系碩一丁組 M9603416 吳韋霆
程式碼 • clear all • load transfer.txt; • load tran.txt; • transfer(:,[1 2])=[]; • Targetset=transfer; • [r_tran, c_tran]=size(tran); • Dataset=tran; • ind_train=1:3:(r_tran); • ind_val=2:3:(r_tran); • ind_test=3:3:(r_tran);
程式碼 • data_train=Dataset(ind_train,:); tar_train=Targetset(ind_train,:); • dtmn=min(data_train)'; dtmx=max(data_train)'; • net01 = newff([dtmn dtmx],[10 1],{'tansig' 'purelin'},'trainlm'); • data_val.P=Dataset(ind_val,:)'; data_val.T=Targetset(ind_val,:)'; • data_test.P=Dataset(ind_val,:)'; data_test.T=Targetset(ind_val,:)'; • [net02,tr]=train(net01, data_train', tar_train',[],[],data_val,data_test);
證實 • Yt = sim(net02,Set03'); • plot(Yt)