1. 心脏指数
2. 心搏量指数
3. 舒张压
4. 肺动脉压
5. 心室压力
6. 肺阻力
7. 是否存活

# 主成分PCA

``acp=PCA(X)``

`` 是否存活= 是否存活=="存活")*1``

``plot(cp  )``

``````PCA(X,ncp=ncol(X))
function(d1,d2,Mat,reg){
z=Mat %*% c(d1,d2,rep(0,ncol(X)-2))
newd=data.frame(t(z*s+m))
pred(reg, newd  }``````

# 逻辑回归

``````reg_tot=step(glm(是否存活~. ,
family=binomial))``````

``````xgrid=seq(-5,5,length=25 )
ygrid=seq(-5,5,length=25 )
zgrid=ter(xgrid,ygrid,p)``````

``````PCA(data,quali.sup=8 )

contour( zgrid )``````

`````` glm(是否存活~.,
family=binomial)

contour(xgrid,ygrid,zgrid )``````

# 决策树

``> plot( re,type=4,extra=6)``

``````rpart(factor(是否存活)~ ,
+       control=rpart.control(minsplit=10))``````

`````` rpart(
+        control=rpart.control(minsplit=5))``````

``````> p=function(d1,d2) pred2(d1,d2 )

> zgrid=Outer(xgrid,ygrid,p)
PCA(  quali.sup=8,graph=TRUE)
> image(xgrid,ygrid,zgrid )

`` rpart( control=rpart.control(minsplit=5))``

`````` > for(i in 1:1200){
+ indice = sample(1:nrow(MYOCARDE),
+ arbre_b = rpart(factor(是否存活)~.,
+}
>Zgrid = Z/1200``````

## 随机森林

``````> fore= randomForest(factor(是否存活)~.,
> pF=function(d1,d2) pred2(d1,d2,Minv,fore)
> zgridF=Outer(xgrid,ygrid,pF)
PCA(data,.sup=8,graph=TRUE)
> contour(xgrid,ygrid,zgridF,``````

169 声望
27 粉丝