R/predict.dsda.R

Defines functions predict.dsda

Documented in predict.dsda

predict.dsda <- function(object,newx, z=NULL, ztest=NULL, gamma=NULL, ...){

  if (is.null(z)){
    beta <- object$beta
    pred <- as.matrix(cbind(1,newx)%*%beta)
    pred <- ifelse(pred>0,2,1)
  }else{
    
    beta <- object$beta
    pred <- as.matrix(cbind(1,newx)%*%beta+ztest%*%gamma)
    print('a')
    print(pred)
    pred <- ifelse(pred>0,2,1)
  }
  
  pred

  
}

Try the TULIP package in your browser

Any scripts or data that you put into this service are public.

TULIP documentation built on Jan. 13, 2021, 3:14 p.m.