| evaluate | R Documentation | 
Evaluate a caret model using the metrics of summaryFunction.
evaluate(x, ...) ## S3 method for class 'train' evaluate( x, testdata = NULL, testy = NULL, testindex = NULL, summaryFunction = NULL, calc.train = TRUE, errorFunction = ci_95, ... ) ## S3 method for class 'evaluate.train' plot(x, plot_errorbar = TRUE, ...) ## S3 method for class 'evaluate.train' dot_plot(x, data = NULL, metric = "all", ...) ## S3 method for class 'evaluate.train' pairs_plot(x, data = NULL, metric = NULL, fixed_axis = TRUE, ...)
x | 
 An object returned by   | 
... | 
 ignored  | 
testdata | 
 A data.frame with test values to be evaluated. If   | 
testy | 
 A factor of response variable of   | 
testindex | 
 A list with rows index of testdata for each resample, preferably an output of
  | 
summaryFunction | 
 A Summary function (one of   | 
calc.train | 
 logical. Evaluate training data? If   | 
errorFunction | 
 A function used to calculate errors across resamples. Default is 95% confidence interval.
If   | 
plot_errorbar | 
 logical. Should plot error bars?  | 
data | 
 Which data type to plot? Should be either 'train' or 'test'.
When   | 
metric | 
 A character, indicating which metric to plot. If   | 
fixed_axis | 
 logical. Should axis in all plots be fixed to the same limits?  | 
An S3 object of class 'evaluate.train', including:
 eval - A data.table in the long format with data type, metrics, values and error across resamples.
If errorFunction != NULL, values are means across resamples.
resample - A data.table with metrics in each resample.
This function is somewhat similar to resamples, however this function
supports evaluation using test data, a custom threshold (use setThreshold), or a different summaryFunction.
confusionMatrix2 ROCcurve
## Not run: evaluate(model) # evaluate test data only testindex <- create.test.index(testdata$response) # get response of testdata evaluate(model, testdata, testindex = testindex, calc.train = FALSE) # for multiple models models <- list(model1, model2, model3) e <- evaluate(models, summaryFunction = twoClassSummary) plot(e) dot_plot(e, data.type = "test", metric = "ROC") pairs_plot(e) pairs_plot(e, fixed_axis = FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.