亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lssvm_demo.m

?? 使用PCA算法的故障診斷MATLAB仿真程序
?? M
字號:
function lssvm_demo%% LSSVM_DEMO - demonstrate l-o-o model selection for the LS-SVM%%    LSSVM_LOO demonstrates the use of leave-one-out cross-validation to%    select the hyper-parameters (i.e. the regularisation and kernel%    parameters) for a least-squares support vector machine.%%% File        : lssvm_demo.m%% Date        : Saturday 6th January 2007.%% Author      : Dr Gavin C. Cawley%% Description : Simple demonstration of model selection for least-squares%               support vecor machines [1] by minimisation of the leave-one-out%               cross-validation error, i.e. Allen's PRESS statistic [2,3].%               The PRESS statistic is minimised using a simple Nelder-Mead%               simplex optimiser [4].%% References  : [1] Suykens, J. A. K., Van Gestel, T., De Brabanter, J.,%                   De Moor, B. and Vanderwalle, J., "Least Squares Support%                   Vector Machines", World Scientific Publishing, 2002.%%               [2] Allen, D. M., "The relationship between variable selection%                   and prediction", Technometrics, vol. 16, pp. 125-127, 1974.%%               [3] Cawley, G. C., "Leave-one-out cross-validation based model%                   selection criteria for weighted LS-SVMs", In Proceedings%                   of the International Joint Conference on Neural Networks%                   (IJCNN-2006)", pp. 2970-2977, Vancouver, BC, Canada,%                   July 16-21 2006.%%               [4] J. A. Nelder and R. Mead, "A simplex method for function%                   minimization", Computer Journal, 7:308-313, 1965.%% History     : 06/01/2007 - v1.00%% Copyright   : (c) Dr Gavin C. Cawley, January 2007.%%    This program is free software; you can redistribute it and/or modify%    it under the terms of the GNU General Public License as published by%    the Free Software Foundation; either version 2 of the License, or%    (at your option) any later version.%%    This program is distributed in the hope that it will be useful,%    but WITHOUT ANY WARRANTY; without even the implied warranty of%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%    GNU General Public License for more details.%%    You should have received a copy of the GNU General Public License%    along with this program; if not, write to the Free Software%    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA%% generate synthetic training and test data[x_train,t_train] = synthetic(128);[x_test, t_test]  = synthetic(8192);ntp               = length(t_train);% perform model selection using PRESS and Nelder-Mead simplexfprintf(1, 'performing model selection...\n');opts        = simplex;opts.TolFun = 1e-6;opts.TolX   = 1e-6;theta       = [-4;4];        % default parameters (result in over-fitting)theta       = simplex(@press, theta, opts, x_train, t_train);lambda      = 2^theta(1);   % regularisation parametereta         = 2^theta(2);   % kernel parameter% train final modelfprintf(1, 'training final model...\n');[L,alpha,b] = press(theta, x_train, t_train);% draw a pretty picturefprintf(1, 'plotting decision boundary...\n');figure(1);clf;set(axes, 'FontSize', 12);h1      = plot(x_train(t_train == +1, 1), x_train(t_train == +1, 2), 'r+');hold on;h2      = plot(x_train(t_train == -1, 1), x_train(t_train == -1, 2), 'go');a       = axis;[X,Y]   = meshgrid(a(1):0.02:a(2),a(3):0.02:a(4));y       = rbf(eta, [X(:) Y(:)], x_train)*alpha + b;y       = reshape(y, size(X));hold on[c,h3]  = contour(X, Y, y, [+1.0 +1.0], 'r--');[c,h4]  = contour(X, Y, y, [+0.0 +0.0], 'b-');[c,h5]  = contour(X, Y, y, [-1.0 -1.0], 'g-.');hold offhandles = [h1 ; h2 ; h3(1) ; h4 ; h5];legend(handles, 'class 1', 'class 2', 'p = 0.1', 'p = 0.5', 'p = 0.9', 'Location', 'NorthWest');drawnow;% evaluate performance on test and training datay_train = rbf(eta, x_train, x_train)*alpha + b;fprintf(1, 'training error = %6.2f%%\n', 100*mean((y_train>0)~=(t_train>0)));y_test = rbf(eta, x_test, x_train)*alpha + b;fprintf(1, 'test error     = %6.2f%%\n', 100*mean((y_test>0)~=(t_test>0)));%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                               SUBFUNCTIONS                                  %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [x,t] = synthetic(ntp)%% SYNTHETIC - generate synthetic benchmark datax = [sqrt(0.03)*randn(ceil(ntp/4),2)+repmat([+0.4 +0.7],ceil(ntp/4),1);...     sqrt(0.03)*randn(ceil(ntp/4),2)+repmat([-0.3 +0.7],ceil(ntp/4),1);...     sqrt(0.03)*randn(ceil(ntp/4),2)+repmat([-0.7 +0.3],ceil(ntp/4),1);...     sqrt(0.03)*randn(ceil(ntp/4),2)+repmat([+0.3 +0.3],ceil(ntp/4),1)]; t = [+ones(ceil(ntp/4),1);...     +ones(ceil(ntp/4),1);...     -ones(ceil(ntp/4),1);...     -ones(ceil(ntp/4),1)];% randomise order of training patternsidx = randperm(length(t));x   = x(idx,:);t   = t(idx);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function K = rbf(eta, x1, x2)%% RBF - evaluate radial basis function (RBF) kernelones1 = ones(size(x1, 1), 1);ones2 = ones(size(x2, 1), 1);K     = exp(-eta*(sum(x1.^2,2)*ones2' + ones1*sum(x2.^2,2)' - 2*x1*x2'));%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [L,alpha,b] = press(theta, x, t)%% PRESS - evaluate hyper-parameters using Allen's PRESS statistic[alpha,b,r] = train(theta, x, t);L           = mean(r.^2);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [alpha,b,r] = train(theta, x, t)%% TRAIN - train a least-squares support vector machine% re-parameterise strictly positive hyper-parameterslambda = 2^theta(1);   % regularisation parametereta    = 2^theta(2);   % kernel parameter% evaluate the kernel matrixK = rbf(eta, x, x);% train least-squares support vector machinentp           = size(x,1);R             = chol(K + lambda*eye(ntp));xi            = R\(R'\[t ones(ntp,1)]);zeta          = xi(:,1);xi            = xi(:,2);oneoversumxi = 1/sum(xi);b             = oneoversumxi*sum(zeta);alpha         = zeta - xi*b;% evaluate the model selection criterionif nargout > 2   Ri  = inv(R);   Cii = sum(Ri.^2,2) - oneoversumxi*xi.^2;   r   = alpha./Cii;end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [x,y,X,Y] = simplex(func, x, opts, varargin)%% SIMPLEX - multidimensional unconstrained non-linear optimsiation%%    X = SIMPLEX(FUNC,X) finds a local minumum of a function, via a function%    handle FUNC, starting from an initial point X.  The local minimum is%    located via the Nelder-Mead simplex algorithm [1], which does not require%    any gradient information.%%    [X,Y] = SIMPLEX(FUNC,X) also returns the value of the function, Y, at%    the local minimum, X.%%    X = SIMPLEX(FUNC,X,OPTS) allows the optimisation parameters to be%    specified via a structure, OPTS, with members%%       opts.Chi         - Parameter governing expansion steps%       opts.Delta       - Parameter governing size of initial simplex.%       opts.Gamma       - Parameter governing contraction steps.%       opts.Rho         - Parameter governing reflection steps.%       opts.Sigma       - Parameter governing shrinkage steps.%       opts.MaxIter     - Maximum number of optimisation steps.%       opts.MaxFunEvals - Maximum number of function evaluations.%       opts.TolFun      - Stopping criterion based on the relative change in%                          value of the function in each step.%       opts.TolX        - Stopping criterion based on the change in the%                          minimiser in each step.%%    OPTS = SIMPLEX() returns a structure containing the default optimisation%    parameters, with the following values:%%       opts.Chi         = 2%       opts.Delta       = 0.01%       opts.Gamma       = 0.5%       opts.Rho         = 1%       opts.Sigma       = 0.5%       opts.MaxIter     = 200%       opts.MaxFunEvals = 1000%       opts.TolFun      = 1e-3%       opts.TolX        = 1e-3%%    X = SIMPLEX(FUNC,X,OPTS, P1, P2, ...) allows addinal parameters to be%    passed to the function to be minimised.%%    [X,Y,XX,YY] = SIMPLEX(FUNC, X) also returns in XX all of the values of%    X evaluated during the optimisation process and in YY the corresponding%    values of the function.%%    References:%%       [1] J. A. Nelder and R. Mead, "A simplex method for function%           minimization", Computer Journal, 7:308-313, 1965.if nargin < 3   opts.Chi         = 2;   opts.Delta       = 0.01;   opts.Gamma       = 0.5;   opts.Rho         = 1;   opts.Sigma       = 0.5;   opts.MaxIter     = 200;   opts.MaxFunEvals = 1000;   opts.TolFun      = 1e-3;   opts.TolX        = 1e-3;endif nargin == 0   x = opts;   returnend% get initial parametersn = length(x);x = repmat(x', n+1, 1);y = zeros(n+1, 1);% form initial simplexfor i=1:n   x(i,i) = x(i,i) + opts.Delta;      y(i)   = func(x(i,:), varargin{:});endy(n+1) = func(x(n+1,:), varargin{:});X      = x;Y      = y;count  = n+1;format = '  % 4d        % 4d     % 12f     %s\n';fprintf(1, '\n Iteration   Func-count    min f(x)    Procedure\n\n');fprintf(1, format, 1, count, min(y), 'initial');% iterative improvementfor i=2:opts.MaxIter   % order   [y,idx] = sort(y);   x       = x(idx,:);   % reflect   centroid = mean(x(1:end-1,:));   x_r      = centroid + opts.Rho*(centroid - x(end,:));   y_r      = func(x_r, varargin{:});   count    = count + 1;   X        = [X ; x_r];   Y        = [Y ; y_r];   if y_r >= y(1) & y_r < y(end-1)      % accept reflection point      x(end,:) = x_r;      y(end)   = y_r;      fprintf(1, format, i, count, min(y), 'reflect');   else      if y_r < y(1)         % expand         x_e   = centroid + opts.Chi*(x_r - centroid);         y_e   = func(x_e, varargin{:});         count = count + 1;         X     = [X ; x_e];         Y     = [Y ; y_e];         if y_e < y_r            % accept expansion point            x(end,:) = x_e;            y(end)   = y_e;            fprintf(1, format, i, count, min(y), 'expand');         else            % accept reflection point            x(end,:) = x_r;            y(end)   = y_r;            fprintf(1, format, i, count, min(y), 'reflect');         end      else          % contract         shrink = 0;         if y(end-1) <= y_r & y_r < y(end)            % contract outside            x_c   = centroid + opts.Gamma*(x_r - centroid);            y_c   = func(x_c, varargin{:});            count = count + 1;            X     = [X ; x_c];            Y     = [Y ; y_c];            if y_c <= y_r                           % accept contraction point               x(end,:) = x_c;               y(end)   = y_c;               fprintf(1, format, i, count, min(y), 'contract outside');            else               shrink = 1;            end         else            % contract inside            x_c   = centroid + opts.Gamma*(centroid - x(end,:));            y_c   = func(x_c, varargin{:});            count = count + 1;            X     = [X ; x_c];            Y     = [Y ; y_c];            if y_c <= y(end)                           % accept contraction point               x(end,:) = x_c;               y(end)   = y_c;               fprintf(1, format, i, count, min(y), 'contract inside');            else               shrink = 1;            end         end         if shrink                     % shrink            for j=2:n+1               x(j,:) = x(1,:) + opts.Sigma*(x(j,:) - x(1,:));               y(j)   = func(x(j,:), varargin{:});               count  = count + 1;               X      = [X ; x(j,:)];               Y      = [Y ; y(j)];            end            fprintf(1, format, i, count, min(y), 'shrink');         end      end   end   % evaluate stopping criterion   if max(abs(min(x) - max(x))) < opts.TolX      fprintf(1, 'optimisation terminated sucessfully (TolX criterion)\n');       break;   end   if abs(max(y) - min(y))/max(abs(y))  < opts.TolFun      fprintf(1, 'optimisation terminated sucessfully (TolFun criterion)\n');       break;   end endif i == opts.MaxIter   fprintf(1, 'Warning : maximim number of iterations exceeded\n'); end% update model structure[y, idx] = min(y);x        = x(idx,:);% bye bye...

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区三区高清aⅴ| 亚洲精品高清在线| 久久久www成人免费无遮挡大片| 国产精品成人一区二区三区夜夜夜 | 亚洲三级在线免费观看| 久久国产成人午夜av影院| 99精品久久久久久| 久久这里只有精品视频网| 一个色综合av| va亚洲va日韩不卡在线观看| 欧美一区二区三区四区五区| 一卡二卡欧美日韩| 国产精品1区2区| 日韩免费观看2025年上映的电影| 亚洲另类在线制服丝袜| 国产一区二区视频在线| 91首页免费视频| 99热这里都是精品| 国产在线一区观看| 欧美日韩中文一区| 一区二区三区小说| 不卡一区二区在线| 日本一区二区三级电影在线观看| 日本不卡123| 欧美麻豆精品久久久久久| ...av二区三区久久精品| 福利一区二区在线观看| 久久综合精品国产一区二区三区 | 久久精品一区二区三区四区| 日韩电影免费在线| 欧美日韩一区二区三区免费看| 日韩久久一区二区| 成人午夜激情在线| 久久久高清一区二区三区| 国模套图日韩精品一区二区| 欧美成人精品二区三区99精品| 日韩电影在线观看一区| 欧美一区二区视频在线观看2020| 日日摸夜夜添夜夜添亚洲女人| 欧美伊人久久久久久久久影院| 久久超级碰视频| 欧美一级欧美三级在线观看| 日本美女视频一区二区| 欧美高清www午色夜在线视频| 舔着乳尖日韩一区| 91精品国产手机| 久久国产精品72免费观看| 欧美精品一区二区三区一线天视频| 理论电影国产精品| 久久精品一区二区三区不卡牛牛| 国产盗摄女厕一区二区三区| 国产精品三级久久久久三级| 99精品一区二区三区| 亚洲老司机在线| 9191国产精品| 国产乱码一区二区三区| 国产精品乱码人人做人人爱| 色欧美片视频在线观看在线视频| 亚洲综合无码一区二区| 91精品国产91久久久久久一区二区 | 亚洲五码中文字幕| 日韩三级视频中文字幕| 国产精品18久久久久久久久久久久| 国产视频亚洲色图| 91久久久免费一区二区| 午夜精品成人在线视频| 久久久亚洲精华液精华液精华液| 成人看片黄a免费看在线| 一区二区不卡在线播放 | 国产成人av电影免费在线观看| 国产精品区一区二区三| 欧美日韩在线三级| 国产尤物一区二区| 夜色激情一区二区| 337p日本欧洲亚洲大胆色噜噜| 欧美日韩综合在线免费观看| 国产一区二区中文字幕| 曰韩精品一区二区| 亚洲精品在线三区| 日本韩国一区二区三区| 国内精品写真在线观看| 亚洲免费在线电影| 欧美精品一区二区在线观看| 色综合天天综合色综合av| 麻豆视频观看网址久久| 亚洲色图制服诱惑 | 26uuuu精品一区二区| 99热精品一区二区| 寂寞少妇一区二区三区| 亚洲观看高清完整版在线观看| 久久精品一级爱片| 91精品国产综合久久久蜜臀粉嫩 | 国产精品综合二区| 午夜亚洲国产au精品一区二区| 久久久91精品国产一区二区三区| 欧美精品色综合| 91色视频在线| 成人黄色在线视频| 国产在线播放一区二区三区| 亚洲一区二区高清| 中文字幕一区二区三| 日韩午夜精品视频| 欧美日韩国产首页| 99精品久久99久久久久| 国产成人午夜高潮毛片| 三级在线观看一区二区| 亚洲一区在线看| 伊人婷婷欧美激情| 中文字幕亚洲一区二区va在线| 久久久亚洲精品石原莉奈| 欧美成人一区二区三区| 欧美日韩国产高清一区二区三区 | 色综合天天综合网天天看片| 国产精品一区二区果冻传媒| 成人免费毛片aaaaa**| 精品一区二区三区免费毛片爱 | **性色生活片久久毛片| 久久久久久电影| 久久夜色精品国产噜噜av| 欧美精品一区二区三区一线天视频| 制服丝袜一区二区三区| 欧美一区二区久久久| 日韩视频永久免费| www久久久久| 久久综合资源网| 国产亚洲精品bt天堂精选| 久久久久久久久久久久久夜| 久久久久久久久久久99999| 国产性色一区二区| 国产精品久久久一本精品| 亚洲丝袜美腿综合| 亚洲卡通欧美制服中文| 亚洲国产日韩一级| 日韩激情视频网站| 久久激五月天综合精品| 久久er精品视频| 亚洲狠狠爱一区二区三区| 日本伊人色综合网| 日韩成人av影视| 国产精品成人一区二区三区夜夜夜| 亚洲久本草在线中文字幕| 亚洲精品欧美激情| 亚洲一区二区三区在线播放| 一区二区久久久久久| 免费在线观看视频一区| 久久精品国产久精国产爱| 精品一二三四区| 国产成人高清在线| 在线亚洲精品福利网址导航| 色婷婷av一区二区三区之一色屋| 色偷偷88欧美精品久久久| 在线欧美日韩国产| 日韩精品中文字幕一区| 亚洲乱码日产精品bd| 一个色综合网站| 日韩国产成人精品| 狠狠色综合播放一区二区| 国产98色在线|日韩| 99久久精品99国产精品| 欧美三级三级三级爽爽爽| 欧美日韩一区成人| 中文字幕二三区不卡| 亚洲精选视频免费看| 日本亚洲电影天堂| 蜜臀av一区二区在线观看| av在线一区二区| 欧美福利视频一区| 久久精品一区二区三区不卡| 欧美激情综合在线| 欧美a级理论片| 成人av电影在线网| 欧美日韩中文字幕精品| 欧美一卡二卡在线| 亚洲综合视频在线| 精品一区二区三区在线播放 | 亚洲妇女屁股眼交7| 丝袜诱惑制服诱惑色一区在线观看 | 久久免费精品国产久精品久久久久| 国产精品久久国产精麻豆99网站| 午夜成人在线视频| 91视频精品在这里| 国产午夜精品福利| 日本亚洲欧美天堂免费| 国产精品99久久久久久似苏梦涵 | 成人精品国产免费网站| 欧美日韩国产高清一区二区三区 | 久久精品久久99精品久久| 91亚洲永久精品| 亚洲国产精品成人综合| 日韩成人一区二区| 91成人在线免费观看| 精品福利一二区| 夜夜爽夜夜爽精品视频| 国产成人精品三级| 欧美不卡在线视频| 亚洲高清三级视频| 欧美系列一区二区| 亚洲丝袜制服诱惑| 粉嫩久久99精品久久久久久夜| 日韩女优电影在线观看|