Description Usage Arguments Details Value Examples
Find the model outputs for specified inputs. This is equivalent to the
generic predict()
function, except it will choose sensible values
by default. This simplifies getting a quick look at model values.
1 2 3 |
model |
the model to display graphically |
data |
optional set of cases from which to extract levels for explanatory variables |
append |
flag whether to include the inputs to the model along with the calculated
model value in the output. Default: |
interval |
the type of interval to use: "none", "confidence", "prediction". But not all types are available for all model architectures. |
nlevels |
how many levels to construct for input variables. (default: 3) For quantitative variables, this is a suggestion; an attempt is made to have the levels equally spaced. If you're dissatisfied with the result, use the ... to specify exactly what levels you want for any variable. |
bootstrap |
if > 1, the number of bootstrap trials to run to construct a
standard error on the model output for each value of the inputs. This is an alternative to
|
... |
arguments about or values at which to evaluate the model or the kind of output to be passed along to predict().
Unlike |
on_training |
flag whether to use the training data for evaluation. Only needed
when there are random terms, e.g. from |
There are four distinct ways to specify the values at which the model is to be evaluated.
(1) Look for some "typical values" in the data to create a handful of inputs. This is useful for
getting a quick look at what the output of the model looks like. This is the default behavior. (2) Using data =
to a dataframe containing the explanatory variables will evaluate the model
at all of the cases contained in that dataframe. (3) Setting input variables explicitly by using
arguments of the form var_name = values, e.g. sex = "F"
. If not all input variables are specified in
this way, the ones that are not will have values set per (1). All combinations of the various variables
will be created. See the nlevels
argument. (4) Evaluating the model on the training data.
There are two ways to do this. The first is
to set the data
argument to the same data frame used to train the model. The second
is to use the on_training = TRUE
argument. These are equivalent unless there is
some random component among the explanatory terms, as with mosaic::rand()
, mosaic::shuffle()
and so on.
A dataframe containing both the explanatory variable inputs and
the resulting model output (in the model_value
field). This differs from the output
of predict()
, which for many model classes/architectures may be a vector or matrix.
A data frame containing both the inputs to the model and the corresponding outputs.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.