From de17a6d755e9369a91abdb06562ee93d7b323bbd Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 4 Apr 2018 15:06:33 -0400 Subject: Adhere to generic function signatures --- R/predict.gensvm.grid.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'R/predict.gensvm.grid.R') diff --git a/R/predict.gensvm.grid.R b/R/predict.gensvm.grid.R index df48d76..acc838f 100644 --- a/R/predict.gensvm.grid.R +++ b/R/predict.gensvm.grid.R @@ -7,9 +7,9 @@ #' this model is only available if \code{refit=TRUE} was specified in the #' \code{\link{gensvm.grid}} call (the default). #' -#' @param grid A \code{gensvm.grid} object trained with \code{refit=TRUE} -#' @param newx Matrix of new values for \code{x} for which predictions need to -#' be computed. +#' @param object A \code{gensvm.grid} object trained with \code{refit=TRUE} +#' @param newdata Matrix of new values for \code{x} for which predictions need +#' to be computed. #' @param \dots further arguments are passed to predict.gensvm() #' #' @return a vector of class labels, with the same type as the original class @@ -44,12 +44,12 @@ #' # predict training sample #' y.hat <- predict(grid, x) #' -predict.gensvm.grid <- function(grid, newx, ...) +predict.gensvm.grid <- function(object, newdata, ...) { - if (is.null(grid$best.estimator)) { + if (is.null(object$best.estimator)) { cat("Error: Can't predict, the best.estimator element is NULL\n") return } - return(predict(grid$best.estimator, newx, ...)) + return(predict(object$best.estimator, newdata, ...)) } -- cgit v1.2.3