data(MedulloblastomaData)
X <- t(MedulloblastomaData[2:655,]) #covariates
Y <- MedulloblastomaData[1,] #response
X <- matrix(as.numeric(X),nrow=23)
p <- ncol(X)
n <- nrow(X)
#standarization
X_new=data.frame()
for (i in 1:p){
X_new[1:n,i]=(X[,i]-rep(mean(X[,i]),n))/sd(X[,i])
}
X_new=matrix(unlist(X_new),nrow = n)
# \donttest{
#estimate graphical model
result <- boost.graph(data = X_new, thre = 0.2, ite1 = 3, ite2 = 0, ite3 = 0, rep = 1)
theta.hat <- result$w
theta.hat[which(theta.hat<0.8)]=0 #keep the highly dependent pairs
#predict
pre <- LDA.boost(data = X_new, resp = Y, theta = theta.hat)
estimated_Y <- pre$class# }
Run the code above in your browser using DataLab