/
predict-Maxnet.R
35 lines (33 loc) · 979 Bytes
/
predict-Maxnet.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
setGeneric("predict", function(object, ...)
standardGeneric("predict")
)
#' Predict Maxnet
#'
#' Predict the output for a new dataset from a trained Maxnet model.
#'
#' @param object \linkS4class{Maxnet} object.
#' @param data data.frame with the data for the prediction.
#' @param type character. Maxnet output type, possible values are "link",
#' "exponential", "cloglog" and "logistic".
#' @param clamp logical for clumping during prediction.
#'
#' @details Used by the \link{predict,SDMmodel-method}, not exported.
#'
#' @include Maxnet-class.R
#'
#' @return A vector with the predicted values.
#'
#' @author Sergio Vignali
setMethod(
f = "predict",
signature = "Maxnet",
definition = function(object,
data,
type = c("link", "exponential", "cloglog", "logistic"),
clamp = TRUE) {
predict(object@model,
newdata = data,
type = type,
clamp = clamp)
}
)