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

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

?? gapls.m

?? 遺傳算法與PLS結合的程序
?? M
字號:
% Application of GA to the selection of the "best" subset
% for a PLS regression.
%
% by R. Leardi
%
% Dipartimento di Chimica e Tecnologie Farmaceutiche ed Alimentari
% via Brigata Salerno (ponte) - 16147 GENOVA (ITALY)
% e-mail: riclea@dictfa.unige.it
%
% The syntax is: [b,fin,sel]=gapls(dataset,evaluat)
% where b=vector of the variables in decreasing order of selection
%       fin=matrix with the results of the final stepwise:
%           row 1 = # of variables used
%           row 2 = response (% C. V.)
%           row 3 = # of components
%           row 4 = RMSECV
%	sel=vector with the frequency of selection
%
% The y variable is the last one
%
% This version has no interactive input, and therefore repeated series
% of runs can be performed.
% 2 input parameters have to be specified:
% 1) data set
% 2) number of evaluations per run

function [b,fin,sel]=gapls(dataset,evaluat)
clc
format compact
randomiz
[o,c]=size(dataset);
disp(['objects: ' int2str(o)])
y=dataset(:,c);
v=c-1;
disp(['variables: ' int2str(v)]);
s1=[];s2=[];b=[];fin=[];sel=[];

aut=2; % autoscaling; 0=raw data; 1=column centering
ng=5; % 5 deletion groups
cr=30; % 30 chromosomes
probsel=5/v; % on average 5 variables per chromosome in the orig. pop.
maxvar=30; % 30 variables as a maximum
probmut=0.01; % probability of mutation 1%
probcross=0.5; % probability of cross-over 50%
freqb=100; % backward stepwise every 100 evaluations 
if floor(evaluat/100)==evaluat/100;
  endb='N';
else
  endb='Y';
end
runs=100; % 100 runs
el=3;

% computation of CV var. with all the variables
% (the optimal number of components will be the maximum for GA)
[maxcomp,start,mxi,sxi,myi,syi]=plsgacv(dataset(:,1:v),y,aut,ng,15);
disp(' ')
disp(['With all the variables:'])
disp(['components: ' int2str(maxcomp)])
disp(['C.V. variance: ' num2str(start)])

sel=zeros(1,v); % sel stores the frequency of selection
for r=1:runs
  sel=[sel 0];
  disp(' ')
  disp(['run ' num2str(r)])
  % creation and evaluation of the starting population
  crom=zeros(cr,v);
  resp=zeros(cr,1);
  comp=zeros(cr,1);
  p=zeros(2,v);
  numvar=zeros(cr,1); %%% numvar stores the number of variables in each chr.
  lib=[]; %%% lib is the matrix with all the already tested chromosomes %%%
  libb=[];%%% libb is the matrix with all the already backw. chromosomes %%%
  nextb=freqb;
  cc=0;
  while cc<cr
    den=0;
    sumvar=0;
    while (sumvar==0 | sumvar>maxvar)
      a=rand(1,v);
      for j=1:v
        if a(1,j)<probsel
          a(1,j)=1;
        else
          a(1,j)=0;
        end    
      end
      sumvar=sum(a);
    end
    den=checktw(cc,lib,a);
    if den==0
      lib=[lib;a];
      if cc>0
        [s1,s2]=chksubs(cc,crom(1:cc,:),a);
      end
      cc=cc+1;  
      var=find(a);
      [fac,risp]=plsgacv(dataset(:,var),y,aut,ng,maxcomp,mxi(:,var),sxi(:,var),myi,syi);
      if isempty(s2)
        mm=0;
      else
        mm=max(resp(s2));
      end
      if risp>mm  % the new chrom. survives only if better
        crom(cc,:)=a;
        resp(cc,1)=risp;
        comp(cc,1)=fac;
        numvar(cc,1)=size(var,2);
        for kk=1:size(s1,2)
          if risp>=resp(s1(kk))
            resp(s1(kk))=0; % the old chrom. are killed if worse
          end
        end
      end
    end
  end

  [vv,pp]=sort(resp);
  pp=flipud(pp);
  crom=crom(pp,:);
  resp=resp(pp,:);
  comp=comp(pp,:);
  numvar=numvar(pp,:);

  disp(' ')
  disp(['After the creation of the original population: ' num2str(resp(1))])
  maxrisp=resp(1);

  while cc<evaluat
    % selection of 2 chromosomes
    cumrisp=cumsum(resp);
    if resp(2)==0
      rr=randperm(cr);
      p(1,:)=crom(rr(1),:);
      if resp(1)==0
        p(2,:)=crom(rr(2),:);
      else
        p(2,:)=crom(1,:);
      end
    else
      k=rand*cumrisp(cr);
      j=1;
      while k>cumrisp(j)
        j=j+1;
      end
      p(1,:)=crom(j,:);
      p(2,:)=p(1,:);
      while p(2,:)==p(1,:)
        k=rand*cumrisp(cr);
        j=1;
        while k>cumrisp(j)
          j=j+1;
        end
        p(2,:)=crom(j,:);
      end
    end

    % cross-over between the 2 chromosomes
    s=p;
    diff=find(p(1,:)~=p(2,:));
    randmat=rand(1,size(diff,2));
    cro=find(randmat<probcross);
    s(1,diff(cro))=p(2,diff(cro));
    s(2,diff(cro))=p(1,diff(cro));

    % mutations
    m=rand(2,v);
    for i=1:2
      f=find((m(i,:))<probmut);
      bb=size(f,2);
      for j=1:bb
        if s(i,f(j))==0
          s(i,f(j))=1;
        else
          s(i,f(j))=0;
        end
      end
    end
 
    % evaluation of the offspring
    for i=1:2
      den=0;
      var=find(s(i,:));
      sumvar=sum(s(i,:));
      if sumvar==0 | sumvar>maxvar
        den=1;
      end
      if den==0
        den=checktw(cc,lib,s(i,:));
      end
      if den==0
        cc=cc+1;  
	[fac,risp]=plsgacv(dataset(:,var),y,aut,ng,maxcomp,mxi(:,var),sxi(:,var),myi,syi);
        lib=[s(i,:);lib];
        if risp>maxrisp
          disp(['ev. ' int2str(cc) ' - ' num2str(risp)])
          maxrisp=risp;
        end
        if risp>resp(cr)
          [crom,resp,comp,numvar]=update(cr,crom,s(i,:),resp,comp,numvar,risp,fac,var);
        end
      end
    end

    % stepwise
    if cc>=nextb
      nextb=nextb+freqb;
      [nc,rispmax,compmax,cc,maxrisp,libb]=backw(r,cr,crom,resp,numvar,cc,dataset,y,aut,ng,maxcomp,maxrisp,libb,mxi,sxi,myi,syi,el);
      if isempty(nc)~=1
	[crom,resp,comp,numvar]=update(cr,crom,nc,resp,comp,numvar,rispmax,compmax,find(nc));
      end
    end

  end

  if endb=='Y' % final stepwise
    [nc,rispmax,compmax,cc,maxrisp,libb]=backw(r,cr,crom,resp,numvar,cc,dataset,y,aut,ng,maxcomp,maxrisp,libb,mxi,sxi,myi,syi,el);
    if isempty(nc)~=1
      [crom,resp,comp,numvar]=update(cr,crom,nc,resp,comp,numvar,rispmax,compmax,find(nc));
    end
  end

  sel=sel(1:v)+crom(1,:);
  disp(find(crom(1,:)))
  figure(1)
  bar(sel);
  set(gca,'XLim',[0 v])
  title(['Frequency of selections after ' int2str(r) ' runs']); 
  drawnow

end

disp('Stepwise according to the frequency of selection');
[a,b]=sort(-sel);
sel=-a;
fin=[];
k=v-1;
if v-1>200
  k=200;
end
for c=1:k
  if sel(c)>sel(c+1)
    [fac,risp]=plsgacv(dataset(:,b(1:c)),y,aut,ng,maxcomp,mxi(:,b(1:c)),sxi(:,b(1:c)),myi,syi);
    sep=sqrt(1-risp/100)*syi(ng+1);sep=sep-sep/(2*o-2); %formula "approssimata" per calcolare sep da % var. sp.
    fin=[fin [c;risp;fac;sep]];
    disp(' ')
    disp(['With ' int2str(c) ' var. ' num2str(risp) ' (' int2str(fac) ' comp.)'])
  end
end

figure(2)
plot(fin(1,:),fin(2,:))
title(['C.V. as a function of the number of selected variables']);
figure(gcf)
disp(' ')
[x,k]=max(fin(2,:));
disp(['Maximum C.V.: ' num2str(x) ' obtained with ' int2str(fin(1,k)) ' variables (' int2str(fin(3,k)) ' comp.):']);
disp(b(1:fin(1,k)))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品第1页| 亚洲综合激情网| 69p69国产精品| 91精品国产综合久久福利| 欧美美女直播网站| 精品视频在线看| 欧美日韩一区国产| 777久久久精品| 日韩你懂的在线播放| 91精品国产91综合久久蜜臀| 日韩一区二区三区在线观看| 日韩视频国产视频| 国产日韩精品一区| 亚洲欧洲精品一区二区三区不卡| 亚洲欧洲av另类| 亚洲一区欧美一区| 蜜臀av一级做a爰片久久| 国产一区二三区| 不卡视频一二三四| 欧美性一区二区| 欧美岛国在线观看| 国产精品系列在线| 一区二区三区美女| 久久国产三级精品| 菠萝蜜视频在线观看一区| 91黄色激情网站| 欧美成人在线直播| 亚洲人一二三区| 蜜臀久久久久久久| 不卡一二三区首页| 制服丝袜一区二区三区| 日本一区二区成人在线| 亚洲va国产天堂va久久en| 韩国女主播成人在线观看| 色综合视频在线观看| 精品国产免费久久| 亚洲欧美激情小说另类| 激情六月婷婷久久| 色呦呦日韩精品| 久久久蜜桃精品| 午夜精品久久久久久久久| 国产成人亚洲精品青草天美| 欧美日韩国产美| 成人免费在线视频| 韩国欧美国产一区| 在线电影一区二区三区| 亚洲欧洲精品一区二区精品久久久 | 亚洲福利视频导航| 狠狠色狠狠色综合系列| 欧洲人成人精品| 国产精品免费av| 精品亚洲免费视频| 欧美久久久一区| 亚洲美女免费在线| 国产成人免费高清| 日韩精品中午字幕| 午夜一区二区三区在线观看| jlzzjlzz亚洲女人18| 久久精品视频免费| 久久成人麻豆午夜电影| 欧美日韩一二区| 亚洲日本在线观看| av亚洲精华国产精华| 国产视频一区在线播放| 蓝色福利精品导航| 日韩欧美国产一二三区| 肉色丝袜一区二区| 欧美网站一区二区| 亚洲国产一区二区三区青草影视| 99久久99久久精品免费观看| 中文字幕的久久| 国产aⅴ精品一区二区三区色成熟| 欧美一级片免费看| 久久99最新地址| 欧美精品一区二区精品网| 久草中文综合在线| 久久久久久久久久久久电影| 狠狠色狠狠色合久久伊人| 欧美精品一区二区三| 国产九色sp调教91| 国产清纯美女被跳蛋高潮一区二区久久w| 精品一区二区三区视频| 久久久久久电影| 国产成人免费在线观看| 国产精品的网站| 91黄色免费版| 日韩激情在线观看| 久久综合999| av一区二区不卡| 亚洲成人在线网站| 精品粉嫩aⅴ一区二区三区四区| 精品夜夜嗨av一区二区三区| 国产亚洲成aⅴ人片在线观看| 粉嫩高潮美女一区二区三区 | 在线亚洲人成电影网站色www| 亚洲欧美日韩国产手机在线| 欧美午夜精品免费| 久久国产精品免费| 亚洲日本在线视频观看| 欧美喷潮久久久xxxxx| 国产一区美女在线| 亚洲久草在线视频| 日韩精品一区二区三区swag| 国产美女一区二区三区| 亚洲午夜国产一区99re久久| 久久蜜桃香蕉精品一区二区三区| 国产剧情一区二区| 亚洲一区二区三区国产| 欧美不卡一区二区三区四区| 成人性色生活片免费看爆迷你毛片| 亚洲六月丁香色婷婷综合久久 | 精品亚洲porn| 最新中文字幕一区二区三区| 在线播放一区二区三区| 成人免费毛片app| 日本系列欧美系列| 亚洲人成精品久久久久| 欧美电影精品一区二区 | 午夜精品视频一区| 国产精品久久久久久久久动漫| 7777精品伊人久久久大香线蕉经典版下载 | 成人免费在线播放视频| 91精品国产综合久久久蜜臀图片| 成人激情动漫在线观看| 麻豆精品视频在线观看视频| 亚洲综合色在线| 中文字幕乱码日本亚洲一区二区 | 久久这里只精品最新地址| 在线亚洲免费视频| av电影在线观看一区| 久久电影网站中文字幕| 五月天国产精品| 亚洲日本在线视频观看| 中文一区在线播放| 精品国产1区二区| 7777女厕盗摄久久久| 91国模大尺度私拍在线视频| 成人高清免费观看| 国产成人精品免费网站| 狠狠色狠狠色综合系列| 久久爱www久久做| 美国av一区二区| 日韩电影一二三区| 性感美女久久精品| 亚洲一区在线看| 亚洲综合男人的天堂| 一区二区激情小说| 亚洲欧美另类图片小说| 亚洲色图欧美在线| 亚洲欧洲99久久| 亚洲黄色在线视频| 一区二区三区四区视频精品免费 | 欧洲一区二区三区免费视频| proumb性欧美在线观看| 99riav久久精品riav| 色综合久久99| 欧美网站大全在线观看| 91精品办公室少妇高潮对白| 色老头久久综合| 91成人在线观看喷潮| 欧美日韩成人综合天天影院| 欧美日韩一级二级| 日韩你懂的在线观看| 久久伊99综合婷婷久久伊| 欧美精品一区二区三区很污很色的| 亚洲精品在线一区二区| 国产欧美一区二区精品仙草咪| 中文字幕日韩一区二区| 亚洲精品你懂的| 日本不卡在线视频| 国产成人在线视频播放| 色婷婷久久久综合中文字幕| 欧美福利视频导航| 欧美xxx久久| ...xxx性欧美| 日本不卡不码高清免费观看| 国产精品自在在线| 色成年激情久久综合| 欧美一区二区三区日韩| 国产日韩一级二级三级| 亚洲视频在线观看一区| 丝袜美腿亚洲色图| 成人免费毛片片v| 欧美电影影音先锋| 中文字幕亚洲欧美在线不卡| 天天操天天色综合| 成人免费黄色在线| 在线91免费看| 中文字幕亚洲在| 日本亚洲最大的色成网站www| 国产91精品露脸国语对白| 欧美日韩国产另类不卡| 国产精品毛片无遮挡高清| 婷婷久久综合九色综合伊人色| 日本vs亚洲vs韩国一区三区 | 精品久久久久久久人人人人传媒| 色偷偷88欧美精品久久久| 欧美一区二区性放荡片| 国产精品久久久久久久久久免费看| 无吗不卡中文字幕|