performance | R Documentation |
Compute measures of model performance.
performance(x, ...)
## S3 method for class 'BinomialVariate'
performance(
x,
y,
weights = NULL,
metrics = MachineShop::settings("metrics.numeric"),
na.rm = TRUE,
...
)
## S3 method for class 'factor'
performance(
x,
y,
weights = NULL,
metrics = MachineShop::settings("metrics.factor"),
cutoff = MachineShop::settings("cutoff"),
na.rm = TRUE,
...
)
## S3 method for class 'matrix'
performance(
x,
y,
weights = NULL,
metrics = MachineShop::settings("metrics.matrix"),
na.rm = TRUE,
...
)
## S3 method for class 'numeric'
performance(
x,
y,
weights = NULL,
metrics = MachineShop::settings("metrics.numeric"),
na.rm = TRUE,
...
)
## S3 method for class 'Surv'
performance(
x,
y,
weights = NULL,
metrics = MachineShop::settings("metrics.Surv"),
cutoff = MachineShop::settings("cutoff"),
na.rm = TRUE,
...
)
## S3 method for class 'ConfusionList'
performance(x, ...)
## S3 method for class 'ConfusionMatrix'
performance(x, metrics = MachineShop::settings("metrics.ConfusionMatrix"), ...)
## S3 method for class 'MLModel'
performance(x, ...)
## S3 method for class 'Resample'
performance(x, ...)
## S3 method for class 'TrainingStep'
performance(x, ...)
x |
observed responses; or confusion, trained model fit, resample, or rfe result. |
... |
arguments passed from the |
y |
predicted responses if not contained in |
weights |
numeric vector of non-negative
case weights for the observed |
metrics |
metric function, function name, or vector of these with which to calculate performance. |
na.rm |
logical indicating whether to remove observed or predicted
responses that are |
cutoff |
numeric (0, 1) threshold above which binary factor probabilities are classified as events and below which survival probabilities are classified. |
plot
, summary
## Requires prior installation of suggested package gbm to run
res <- resample(Species ~ ., data = iris, model = GBMModel)
(perf <- performance(res))
summary(perf)
plot(perf)
## Survival response example
library(survival)
gbm_fit <- fit(Surv(time, status) ~ ., data = veteran, model = GBMModel)
obs <- response(gbm_fit, newdata = veteran)
pred <- predict(gbm_fit, newdata = veteran)
performance(obs, pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.