R/predict_Rcpp_s2net.R

Defines functions predict_Rcpp_s2net

Documented in predict_Rcpp_s2net

# predict.Rcpp_s2net S4 method

predict_Rcpp_s2net <- function(object, newX, type = "default"){
  if(is(newX,"s2Data")){
    # No need to pre-process
    newX = newX$xL
  }
  if(!is.matrix(newX)){
    stop("newX shoud be a matrix or s2Data containing xL")
  }
  switch (type,
    response = {code = 1},
    probs = {code = 2},
    class = {code = 3},
    {code = 0}
  )
  return(object$predict(newX, code))
}

Try the s2net package in your browser

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

s2net documentation built on July 1, 2022, 1:06 a.m.