model_eval | R Documentation |
Evaluate a model on inputs
model_eval(
mod,
data = NULL,
...,
skeleton = FALSE,
ncont = 3,
interval = c("prediction", "confidence", "none"),
level = 0.95,
type = c("response", "link")
)
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. |
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 .lwr
and .upr
bounds of the prediction or confidence interval
if training data is used as the input, then it's possible to calculate the residual. This
will be called .resid
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.