R/predict_Weights2.R

predict.Weights2 <- function(object, newdata, delete.firstColumn=TRUE, ...){
  
  weights <- object
  data <- newdata
  
  # count variables
  numberOfVar <- ncol(data)
  
  start <- 1
  
  # if first column is there
  if(delete.firstColumn){start <- 2}
  
  # calculate prediction
  pred <- apply(data, 1, function(x) computeOutput2(x[start:numberOfVar],weights))
  
  pred
  
}# end of function

Try the TeachNet package in your browser

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

TeachNet documentation built on May 2, 2019, 7 a.m.