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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gapls.m

?? 遺傳算法-偏最小二乘法,用于分析定量GA-PLS
?? M
字號(hào):
% 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)))

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女一区二区久久| 国产综合色产在线精品| 久久久久久久综合狠狠综合| 91麻豆精品视频| 久久成人羞羞网站| 亚洲成人一区在线| 亚洲日本一区二区三区| 亚洲精品一区在线观看| 91精品啪在线观看国产60岁| 97se亚洲国产综合在线| 国产在线精品一区在线观看麻豆| 午夜欧美电影在线观看| 亚洲色图制服诱惑 | 欧美片在线播放| 99re视频精品| 国产99久久久国产精品潘金| 久久国产尿小便嘘嘘| 亚洲va欧美va天堂v国产综合| 日韩一区在线免费观看| 国产亚洲综合色| 日韩欧美国产综合一区 | 亚洲欧美日韩系列| 欧美精彩视频一区二区三区| 欧美一区二区三区四区五区| 色爱区综合激月婷婷| www.性欧美| 成人精品一区二区三区四区| 国内外成人在线| 激情久久五月天| 久久成人免费电影| 黄色日韩三级电影| 激情亚洲综合在线| 久草在线在线精品观看| 奇米影视一区二区三区| 免费久久精品视频| 捆绑调教美女网站视频一区| 美女脱光内衣内裤视频久久网站| 日本欧美一区二区在线观看| 午夜久久电影网| 视频一区欧美精品| 日韩激情视频网站| 日日夜夜一区二区| 青娱乐精品视频在线| 蜜臀av一级做a爰片久久| 九九九精品视频| 国产一区二区精品久久91| 国产资源精品在线观看| 国产成人在线看| 成人精品视频网站| 一本色道a无线码一区v| 欧美日韩一级视频| 欧美一区二区三区喷汁尤物| 日韩欧美国产一区在线观看| 久久久综合激的五月天| 国产精品伦理一区二区| 亚洲自拍偷拍图区| 麻豆一区二区99久久久久| 国产精品1区2区3区在线观看| aa级大片欧美| 欧美日韩中文字幕一区| 日韩欧美精品三级| 亚洲国产激情av| 亚洲一区二区三区四区五区中文| 丝袜美腿亚洲一区| 国产一区二区三区高清播放| 99re热视频这里只精品| 欧美日韩免费在线视频| 欧美r级在线观看| 亚洲欧洲精品天堂一级| 亚洲va韩国va欧美va| 国产在线观看免费一区| 色老综合老女人久久久| 日韩一区二区电影在线| 中文字幕国产一区二区| 亚洲mv在线观看| 粉嫩蜜臀av国产精品网站| 欧美三级电影网站| 26uuu成人网一区二区三区| 自拍视频在线观看一区二区| 日韩国产高清影视| 成人免费va视频| 欧美精品色综合| 国产精品人人做人人爽人人添| 亚洲午夜免费视频| 国产麻豆成人精品| 欧美日韩精品欧美日韩精品一| 久久久国际精品| 天天操天天色综合| av福利精品导航| 欧美xxxxxxxxx| 亚洲一区二区免费视频| 国产成人午夜精品影院观看视频 | 一区二区三区中文在线观看| 精品亚洲porn| 欧美亚洲动漫制服丝袜| 欧美国产一区二区在线观看 | 国产精品一区在线观看乱码| 欧美日韩精品久久久| 国产精品久久久久毛片软件| 久久99精品久久久久久国产越南 | 欧美综合欧美视频| 国产精品视频你懂的| 久久99热这里只有精品| 在线免费不卡电影| 久久男人中文字幕资源站| 偷拍自拍另类欧美| 一本一道综合狠狠老| 亚洲国产激情av| 国产一区二区三区精品视频| 欧美日韩黄色影视| 中文字幕永久在线不卡| 国产成人在线影院| 2020国产精品| 日本91福利区| 在线不卡一区二区| 亚洲精品第1页| 91免费观看在线| 国产精品色一区二区三区| 国产一区二区精品在线观看| 日韩精品影音先锋| 免费人成网站在线观看欧美高清| 色成年激情久久综合| 亚洲欧洲av在线| 成人免费观看av| 日本一区二区三区四区在线视频| 国模一区二区三区白浆| 日韩免费高清av| 免费成人在线网站| 欧美一区二区三区系列电影| 日韩国产在线观看| 在线播放一区二区三区| 亚洲成av人片观看| 欧美日韩高清影院| 亚洲大片精品永久免费| 欧美日本免费一区二区三区| 亚洲一区二区欧美激情| 欧美日韩日日摸| 亚洲成人精品影院| 777久久久精品| 美女精品一区二区| 亚洲精品一区二区在线观看| 狠狠狠色丁香婷婷综合久久五月| 欧美成人精品3d动漫h| 久草精品在线观看| 久久精品一区四区| 成人app网站| 亚洲欧美日韩国产一区二区三区 | 国产麻豆欧美日韩一区| 久久精品综合网| 成人avav在线| 亚洲精品水蜜桃| 欧美日韩国产中文| 琪琪久久久久日韩精品| 久久久噜噜噜久噜久久综合| www.亚洲免费av| 亚洲午夜国产一区99re久久| 欧美日韩成人高清| 美国三级日本三级久久99| 欧美白人最猛性xxxxx69交| 国产伦精一区二区三区| 中文字幕一区日韩精品欧美| 日本国产一区二区| 免费观看一级特黄欧美大片| 久久久99精品免费观看| 99久久精品国产毛片| 午夜精品久久久久久久99水蜜桃| 91精品黄色片免费大全| 国产麻豆精品在线观看| 亚洲精选视频免费看| 制服丝袜亚洲网站| 国产福利不卡视频| 亚洲一区自拍偷拍| 欧美精品一区二区三| aaa欧美大片| 蜜桃在线一区二区三区| 中文字幕不卡在线观看| 欧美日本免费一区二区三区| 国产乱一区二区| 一区二区三区高清不卡| 久久综合中文字幕| 91久久人澡人人添人人爽欧美| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产精品免费视频观看| 欧美一级艳片视频免费观看| 岛国av在线一区| 天天操天天干天天综合网| 国产精品三级视频| 91精品国产aⅴ一区二区| 成人一级视频在线观看| 日本在线不卡一区| 中文字幕视频一区| 欧美变态口味重另类| 在线看国产一区二区| 国产精品影音先锋| 天堂影院一区二区| 1024国产精品| 久久这里只有精品6| 91麻豆精品国产91久久久更新时间 | 国产精品免费网站在线观看| 日韩亚洲欧美一区二区三区|