light_performance: Model Performance of Flashlight
Description
Calculates performance of a flashlight with respect to one or more performance measure.
Usage
light_performance(x, ...)
# S3 method for default
light_performance(x, ...)
# S3 method for flashlight
light_performance(
x,
data = x$data,
by = x$by,
metrics = x$metrics,
use_linkinv = FALSE,
metric_name = "metric",
value_name = "value",
label_name = "label",
...
)
# S3 method for multiflashlight
light_performance(x, ...)
Arguments
x
An object of class flashlight or multiflashlight.
...
Arguments passed from or to other functions.
data
An optional data.frame.
by
An optional vector of column names used to additionally group the results. Will overwrite x$by.
metrics
An optional named list with metrics. Each metric takes at least four arguments: actual, predicted, case weights w and ....
use_linkinv
Should retransformation function be applied? Default is FALSE.
metric_name
Column name in resulting data containing the name of the metric. Defaults to "metric".
value_name
Column name in resulting data containing the value of the metric. Defaults to "value".
label_name
Column name in resulting data containing the label of the flashlight. Defaults to "label".
Value
An object of class light_performance, light (and a list) with the following elements.
data A tibble containing the results. Can be used to build fully customized visualizations.
by Same as input by.
metric_name Same as input metric_name.
value_name Same as input value_name.
label_name Same as input label_name.
Methods (by class)
default: Default method not implemented yet.
flashlight: Model performance of flashlight object.
multiflashlight: Model performance of multiflashlight object.
Details
The minimal required elements in the (multi-) flashlight are "y", "predict_function", "model", "data" and "metrics". The latter two can also directly be passed to light_performance. Note that by default, no retransformation function is applied.