View source: R/light_performance.R
light_performance | R Documentation |
Calculates performance of a flashlight with respect to one or more performance measure.
light_performance(x, ...)
## Default S3 method:
light_performance(x, ...)
## S3 method for class 'flashlight'
light_performance(
x,
data = x$data,
by = x$by,
metrics = x$metrics,
use_linkinv = FALSE,
...
)
## S3 method for class 'multiflashlight'
light_performance(x, ...)
x |
An object of class "flashlight" or "multiflashlight". |
... |
Arguments passed from or to other functions. |
data |
An optional |
by |
An optional vector of column names used to additionally group the results.
Will overwrite |
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 |
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.
An object of class "light_performance" with the following elements:
data
: A tibble containing the results. Can be used to build fully customized
visualizations. Column names can be controlled by
options(flashlight.column_name)
.
by
Same as input by
.
light_performance(default)
: Default method not implemented yet.
light_performance(flashlight)
: Model performance of flashlight object.
light_performance(multiflashlight)
: Model performance of multiflashlight object.
plot.light_performance()
fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "lm", data = iris, y = "Sepal.Length")
light_performance(fl)
light_performance(fl, by = "Species")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.