diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-04-04 15:06:33 -0400 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-04-04 15:06:33 -0400 |
| commit | de17a6d755e9369a91abdb06562ee93d7b323bbd (patch) | |
| tree | cbede010da1046ee6627143aa0e41d8ec0fbb09e /R/predict.gensvm.grid.R | |
| parent | Add importFrom statements (diff) | |
| download | rgensvm-de17a6d755e9369a91abdb06562ee93d7b323bbd.tar.gz rgensvm-de17a6d755e9369a91abdb06562ee93d7b323bbd.zip | |
Adhere to generic function signatures
Diffstat (limited to 'R/predict.gensvm.grid.R')
| -rw-r--r-- | R/predict.gensvm.grid.R | 12 |
1 files changed, 6 insertions, 6 deletions
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, ...)) } |
