标题: Boost to tackle nonlinearity [打印本页] 作者: shiyiming 时间: 2010-10-22 13:39 标题: Boost to tackle nonlinearity From oloolo's blog on SasProgramming
<p><a href="http://feedads.g.doubleclick.net/~a/vxjN9NmrYX5QuayULzfxI_qWna8/0/da"><img src="http://feedads.g.doubleclick.net/~a/vxjN9NmrYX5QuayULzfxI_qWna8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vxjN9NmrYX5QuayULzfxI_qWna8/1/da"><img src="http://feedads.g.doubleclick.net/~a/vxjN9NmrYX5QuayULzfxI_qWna8/1/di" border="0" ismap="true"></img></a></p><pre style="background-color: #ebebeb; border-bottom: #999999 1px dashed; border-left: #999999 1px dashed; border-right: #999999 1px dashed; border-top: #999999 1px dashed; color: #000001; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><code>
data nonlinear;
do x=1 to 627;
p=(sin(x/100)+1)*0.45;
do j=1 to 100;
x1=x+(j-1)/100;
if ranuni(8655645)<=p then y=1; else y=0;
output; drop p j;
end;
end;
run;
proc rank data=nonlinear out=nonlinearrank groups=20;
var x1;
ranks rank1;
run;
proc means data=nonlinearrank noprint;
class rank1;
var y x1;
output out=_mean(where=(_type_=1)) mean(y)=y mean(x1)=x1;
run;
%inc "C:\Documents and Settings\lxie\Desktop\SAS Prog and Docs\Boost macro2 ver3.0.sas";
%inc "C:\Documents and Settings\lxie\Desktop\SAS Prog and Docs\predict macro.sas";
par(mfrow=c(2,1))
for (i in (1:100)){
plot(test2[,i], type='l', ylim=c(-0.5, 1),
main=paste('Iteration', i, 'Delta'),
ylab='Delta')
plot(test[,i], type='l', ylim=minmax,
main=paste('Iteration', i, 'Score'),
ylab='Score')
Sys.sleep(0.1)
}