| model_eval {LSTbook} | R Documentation |
Evaluate a model on inputs
Description
Evaluate a model on inputs
Usage
model_eval(
mod,
data = NULL,
...,
skeleton = FALSE,
ncont = 3,
interval = c("prediction", "confidence", "none"),
level = 0.95,
type = c("response", "link")
)
Arguments
mod |
A model as from |
data |
A data frame of inputs. If missing, the inputs will be assembled from ... or from the training data, or an skeleton will be constructed. |
skeleton |
Logical flag. If |
ncont |
Only relevant to skeleton. The number of levels at which to evaluate continuous variables. See |
interval |
One of "prediction" (default), "confidence", or "none". |
level |
The level at which to construct the interval (default: 0.95) |
type |
Either "response" (default) or "link". Relevant only to glm models. The format of the |
... |
Optional vectors specifying the inputs. See examples. |
Value
A data frame. There is one row for each row of the input values (see data parameter). The
columns include
the explanatory variables
-
.output— the output of the model that corresponds to the explanatory value the
.lwrand.uprbounds of the prediction or confidence intervalif training data is used as the input, the
.responsevariable and the.resid. Note that the generic name.responseis used, not the actual name of the model's response variable.
Examples
mod <- mtcars |> model_train(mpg ~ hp + wt)
model_eval(mod, hp=100, wt=c(2,3))
model_eval(mod) # training data
model_eval(mod, skeleton=TRUE)