powered by
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") )
A data frame. There is one row for each row of the input values (see data parameter). The columns include
data
the explanatory variables
.output --- the output of the model that corresponds to the explanatory value
.output
the .lwr and .upr bounds of the prediction or confidence interval
.lwr
.upr
if training data is used as the input, then it's possible to calculate the residual. This will be called .resid.
.resid
A model as from model_train(), lm() or glm()
model_train()
lm()
glm()
A data frame of inputs. If missing, the inputs will be assembled from ... or from the training data, or an skeleton will be constructed.
Logical flag. If TRUE, a skeleton on inputs will be created. See model_skeleton().
TRUE
model_skeleton()
Only relevant to skeleton. The number of levels at which to evaluate continuous variables. See model_skeleton().
One of "prediction" (default), "confidence", or "none".
The level at which to construct the interval (default: 0.95)
Either "response" (default) or "link". Relevant only to glm models. The format of the .output
Optional vectors specifying the inputs. See 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)
Run the code above in your browser using DataLab