-
大小: 56KB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2021-07-31
- 語言: 其他
- 標(biāo)簽: 工業(yè)過程??故障檢測(cè)??統(tǒng)計(jì)理論??
資源簡介
基于核主元分析(KPCA)的工業(yè)過程故障檢測(cè),代碼已優(yōu)化,運(yùn)行效率高,有詳細(xì)的注釋,附有訓(xùn)練數(shù)據(jù)和測(cè)試數(shù)據(jù)。

代碼片段和文件信息
function?[K]?=?computeKernelMatrix(kerxy)
%?Calculate?kernel?function.???
%
%?x:?輸入樣本d×n1的矩陣n1為樣本個(gè)數(shù)d為樣本維數(shù)
%?y:?輸入樣本d×n2的矩陣n2為樣本個(gè)數(shù)d為樣本維數(shù)
%
%?ker??核參數(shù)(結(jié)構(gòu)體變量)
%?the?following?fields:
%???type???-?linear?:??k(xy)?=?x‘*y
%????????????poly???:??k(xy)?=?(x‘*y+c)^d
%????????????gauss??:??k(xy)?=?exp(-0.5*(norm(x-y)/s)^2)
%????????????tanh???:??k(xy)?=?tanh(g*x‘*y+c)
%???degree?-?Degree?d?of?polynomial?kernel?(positive?scalar).
%???offset?-?Offset?c?of?polynomial?and?tanh?kernel?(scalar?negative?for?tanh).
%???width??-?Width?s?of?Gauss?kernel?(positive?scalar).
%???gamma??-?Slope?g?of?the?tanh?kernel?(positive?scalar).
%
%?ker?=?struct(‘type‘‘linear‘);
%?ker?=?struct(‘type‘‘ploy‘‘degree‘d‘offset‘c);
%?ker?=?struct(‘type‘‘gauss‘‘width‘s);
%?ker?=?struct(‘type‘‘tanh‘‘gamma‘g‘offset‘c);
%
%?K:?輸出核參數(shù)n1×n2的矩陣
%-------------------------------------------------------------%
switch?ker.type
????case?‘linear‘
????????K?=?x*y‘;
????????
????case?‘ploy‘
????????d?=?ker.degree;
????????c?=?ker.offset;
????????K?=?(x‘*y+c).^d;
????????
????case?‘gauss‘
????????s?=?ker.width;
????????sx?=?sum(x.^22);
????????sy?=?sum(y.^22);
????????K?=?exp(0.5*(bsxfun(@minusbsxfun(@minus2*x*y‘sx)sy‘))/s^2);
????case?‘tanh‘
????????g?=?ker.gamma;
????????c?=?ker.offset;
????????K?=?tanh(g*x‘*y+c);
????otherwise
????????K?=?0;
end
end
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????1451??2018-03-17?09:23??computeKernelMatrix.m
?????文件????????3220??2018-03-17?09:22??main.m
?????文件???????27697??2018-03-17?08:47??testData.mat
?????文件???????27448??2018-03-17?08:48??trainData.mat
評(píng)論
共有 條評(píng)論