微信手機(jī)網(wǎng)站開發(fā)外貿(mào)網(wǎng)站外鏈平臺
回歸預(yù)測 | Matlab實(shí)現(xiàn)GA-APSO-MBP、GA-MBP、MBP、BP多輸入單輸出回歸預(yù)測
目錄
- 回歸預(yù)測 | Matlab實(shí)現(xiàn)GA-APSO-MBP、GA-MBP、MBP、BP多輸入單輸出回歸預(yù)測
- 預(yù)測效果
- 基本描述
- 程序設(shè)計(jì)
- 參考資料
預(yù)測效果
基本描述
1.Matlab實(shí)現(xiàn)GA-APSO-MBP、GA-MBP、MBP、BP多輸入單輸出回歸預(yù)測(完整源碼和數(shù)據(jù));
2.改進(jìn)遺傳-粒子群算法優(yōu)化雙層BP神經(jīng)網(wǎng)絡(luò)多輸入單輸出回歸預(yù)測(含遺傳優(yōu)化雙層BP神經(jīng)網(wǎng)絡(luò)、雙層BP神經(jīng)網(wǎng)絡(luò)、單層BP神經(jīng)網(wǎng)絡(luò))對比;
3.輸入7個(gè)特征,輸出單個(gè)變量,運(yùn)行環(huán)境matlab2018及以上;
4.代碼特點(diǎn):參數(shù)化編程、參數(shù)可方便更改、代碼編程思路清晰、注釋明細(xì)。
程序設(shè)計(jì)
- 完整程序和數(shù)據(jù)獲取方式資源出下載Matlab實(shí)現(xiàn)GA-APSO-MBP、GA-MBP、MBP、BP多輸入單輸出回歸預(yù)測。
function ret=Code(lenchrom,bound)
%本函數(shù)將變量編碼成染色體,用于隨機(jī)初始化一個(gè)種群
% lenchrom input : 染色體長度
% bound input : 變量的取值范圍
% ret output: 染色體的編碼值
flag=0;
while flag==0pick=rand(1,length(lenchrom));ret=bound(:,1)'+(bound(:,2)-bound(:,1))'.*pick; %線性插值,編碼結(jié)果以實(shí)數(shù)向量存入ret中flag=test(lenchrom,bound,ret); %檢驗(yàn)染色體的可行性
end
function ret=Decode(lenchrom,bound,code,opts)
% 本函數(shù)對染色體進(jìn)行解碼
% lenchrom input : 染色體長度
% bound input : 變量取值范圍
% code input :編碼值
% opts input : 解碼方法標(biāo)簽
% ret output: 染色體的解碼值
switch optscase 'binary' % binary codingfor i=length(lenchrom):-1:1data(i)=bitand(code,2^lenchrom(i)-1); %并低十位,然后將低十位轉(zhuǎn)換成十進(jìn)制數(shù)存在data(i)里面code=(code-data(i))/(2^lenchrom(i)); %低十位清零,然后右移十位endret=bound(:,1)'+data./(2.^lenchrom-1).*(bound(:,2)-bound(:,1))'; %分段解碼,以實(shí)數(shù)向量的形式存入ret中case 'grey' % grey codingfor i=sum(lenchrom):-1:2code=bitset(code,i-1,bitxor(bitget(code,i),bitget(code,i-1)));endfor i=length(lenchrom):-1:1data(i)=bitand(code,2^lenchrom(i)-1);code=(code-data(i))/(2^lenchrom(i));endret=bound(:,1)'+data./(2.^lenchrom-1).*(bound(:,2)-bound(:,1))'; %分段解碼,以實(shí)數(shù)向量的形式存入ret中case 'float' % float codingret=code; %解碼結(jié)果就是編碼結(jié)果(實(shí)數(shù)向量),存入ret中
end
參考資料
[1] https://blog.csdn.net/kjm13182345320/article/details/129036772?spm=1001.2014.3001.5502
[2] https://blog.csdn.net/kjm13182345320/article/details/128690229