finish_learn.m

来自「一个关于adaboost算法的matlab程序」· M 代码 · 共 37 行

M
37
字号
function bb=finish_learn(bb)% bb=finish_learn(bb)%% clear some variables%   G. Raetsch 10.12.99%   Copyright (c) 1998,1999  GMD Berlin - All rights reserved%   THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of GMD FIRST Berlin%   The copyright notice above does not evidence any%   actual or intended publication of this work.%   Please see COPYRIGHT.txt for details.w=get_vote_weights(bb) ;THRESH=1e-8;if sum(w<=THRESH)>0  fprintf(1,sprintf('\nremoving %i useless hypothesis\n',sum(w<=THRESH))) ;  wls=get_boosted_learner(bb) ;  wls_new=cell(1,get_boost_steps(bb));  w_new=zeros(1,get_boost_steps(bb)) ;  j=0 ;  for i=1:length(w),    if w(i)>THRESH,      j=j+1 ;      wls_new{j}=wls{i} ;      w_new(j)=w(i) ;    end ;  end ;  fprintf(1,sprintf('holding now %i usefull hypothesis\n',j)) ;  bb=set_boosted_learner(bb, wls_new) ;  bb=set_vote_weights(bb, w_new) ;end ;  bb.last_output=[] ;bb.fin_hyp=0 ;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?