【故障診斷】基于隨機(jī)森林實現(xiàn)故障分類附matlab代碼
【故障診斷】基于隨機(jī)森林實現(xiàn)故障分類附matlab代碼
TT_Matlab
博主簡介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡(luò)預(yù)測、信號處理、元胞自動機(jī)、圖像處理、路徑規(guī)劃、無人機(jī)等多種領(lǐng)域的Matlab仿真,完整matlab代碼或者程序定制加qq1575304183。
?作者簡介:熱愛科研的Matlab仿真開發(fā)者,修心和技術(shù)同步精進(jìn),matlab項目合作可私信。
個人主頁: Matlab科研工作室
個人信條:格物致知。
更多Matlab仿真內(nèi)容點擊
智能優(yōu)化算法 神經(jīng)網(wǎng)絡(luò)預(yù)測 雷達(dá)通信 無線傳感器 電力系統(tǒng)
信號處理 圖像處理 路徑規(guī)劃 元胞自動機(jī) 無人機(jī)
? 內(nèi)容介紹
根據(jù)飛機(jī)發(fā)動機(jī)狀態(tài)參數(shù)建立決策樹進(jìn)行分類是發(fā)動機(jī)故障檢測的重要方法,本文針對單棵決策樹模型分類方法精度不高,容易出現(xiàn)過擬合等問題,提出使用組合單決策樹來提高計算精度的隨機(jī)森林算法,并將該方法進(jìn)行仿真實驗.結(jié)果表明,隨機(jī)森林算法能夠解決單個決策樹過擬合問題,在解決飛機(jī)發(fā)動機(jī)故障診斷領(lǐng)域中具有廣闊的發(fā)展及應(yīng)用前景.
? 部分代碼
function [I, T_ini,T_ref] = LIME(L,para)
T_ini = max(L,[],3)+0.02;
[wx, wy] = computeTextureWeights(T_ini, para.sigma);
T_ref = solveLinearEquation(T_ini, wx, wy, para.lambda);
hgamma = vision.GammaCorrector(1/para.gamma,’Correction’,’Gamma’);
T_ref = step(hgamma, T_ref);
I(:,:,1) = L(:,:,1)./T_ref;
I(:,:,2) = L(:,:,2)./T_ref;
I(:,:,3) = L(:,:,3)./T_ref;
end
function [retx, rety] = computeTextureWeights(fin, sigma)
fx = diff(fin,1,2);
fx = padarray(fx, [0 1 0], ’post’);
fy = diff(fin,1,1);
fy = padarray(fy, [1 0 0], ’post’);
vareps_s = 0.02;
vareps = 0.001;
wto = max(sum(sqrt(fx.^2+fy.^2),3)/size(fin,3),vareps_s).^(-1);
fbin = lpfilter(fin, sigma);
gfx = diff(fbin,1,2);
gfx = padarray(gfx, [0 1], ’post’);
gfy = diff(fbin,1,1);
gfy = padarray(gfy, [1 0], ’post’);
wtbx = max(sum(abs(gfx),3)/size(fin,3),vareps).^(-1);
wtby = max(sum(abs(gfy),3)/size(fin,3),vareps).^(-1);
retx = wtbx.*wto;
rety = wtby.*wto;
retx(:,end) = 0;
rety(end,:) = 0;
end
function ret = conv2_sep(im, sigma)
ksize = bitor(round(5*sigma),1);
g = fspecial(’gaussian’, [1,ksize], sigma);
ret = conv2(im,g,’same’);
ret = conv2(ret,g’,’same’);
end
function FBImg = lpfilter(FImg, sigma)
FBImg = FImg;
for ic = 1:size(FBImg,3)
FBImg(:,:,ic) = conv2_sep(FImg(:,:,ic), sigma);
end
end
function OUT = solveLinearEquation(IN, wx, wy, lambda)
%
% The code for constructing inhomogenious Laplacian is adapted from
% the implementaion of the wlsFilter.
%
% For color images, we enforce wx and wy be same for three channels
% and thus the pre-conditionar only need to be computed once.
%
[r,c,ch] = size(IN);
k = r*c;
dx = -lambda*wx(:);
dy = -lambda*wy(:);
B(:,1) = dx;
B(:,2) = dy;
d = [-r,-1];
A = spdiags(B,d,k,k);
e = dx;
w = padarray(dx, r, ’pre’); w = w(1:end-r);
s = dy;
n = padarray(dy, 1, ’pre’); n = n(1:end-1);
D = 1-(e+w+s+n);
A = A + A’ + spdiags(D, 0, k, k);
if exist(’ichol’,’builtin’)
L = ichol(A,struct(’michol’,’on’));
OUT = IN;
for ii=1:ch
tin = IN(:,:,ii);
[tout, flag] = pcg(A, tin(:),0.1,100, L, L’);
OUT(:,:,ii) = reshape(tout, r, c);
end
else
OUT = IN;
for ii=1:ch
tin = IN(:,:,ii);
tout = A in(:);
OUT(:,:,ii) = reshape(tout, r, c);
end
end
end
? 運行結(jié)果
? 參考文獻(xiàn)
[1] 馬輝.基于隨機(jī)森林的光伏電站結(jié)構(gòu)故障診斷與分類研究[D].西安理工大學(xué)[2023-06-13].
[2] 陳蘇雨,方宇,胡定玉,等.基于隨機(jī)森林方法的地鐵車門故障診斷[J].測控技術(shù), 2018, 37(2):5.DOI:CNKI:SUN:IKJS.0.2018-02-006.
[3] 陳冠宇,楊鵬,陳寧.基于隨機(jī)森林算法的船舶電站故障診斷[J].船舶工程, 2023, 45(1):4.
[4] 王 玲,周東方,生擁宏,等.基于隨機(jī)森林算法的模擬電路故障診斷[J].Journal of Terahertz Science and Electronic Information Technology, 16(5)[2023-06-13].
?? 代碼獲取關(guān)注我
??部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除
?? 關(guān)注我領(lǐng)取海量matlab電子書和數(shù)學(xué)建模資料
-
2023年各省最新電價一覽!8省中午執(zhí)行谷段電價! 2023-01-03
-
PPT導(dǎo)出高分辨率圖片的四種方法 2022-09-22
-
2023年最新!國家電網(wǎng)27家省級電力公司負(fù)責(zé)人大盤點 2023-03-14
-
全國消防救援總隊主官及簡歷(2023.2) 2023-02-10
-
盤點 l 中國石油大慶油田現(xiàn)任領(lǐng)導(dǎo)班子 2023-02-28
-
我們的前輩!歷屆全國工程勘察設(shè)計大師完整名單! 2022-11-18
-
關(guān)于某送變電公司“4·22”人身死亡事故的快報 2022-04-26
