MachineShop (version 2.8.0)

plot: Model Performance Plots

Description

Plot measures of model performance and predictor variable importance.

Usage

# S3 method for Calibration
plot(x, type = c("line", "point"), se = FALSE, ...)

# S3 method for ConfusionList plot(x, ...)

# S3 method for ConfusionMatrix plot(x, ...)

# S3 method for LiftCurve plot( x, find = NULL, diagonal = TRUE, stat = MachineShop::settings("stat.Curve"), ... )

# S3 method for MLModel plot( x, metrics = NULL, stat = MachineShop::settings("stat.train"), type = c("boxplot", "density", "errorbar", "line", "violin"), ... )

# S3 method for PartialDependence plot(x, stats = NULL, ...)

# S3 method for Performance plot( x, metrics = NULL, stat = MachineShop::settings("stat.Resamples"), type = c("boxplot", "density", "errorbar", "violin"), ... )

# S3 method for PerformanceCurve plot( x, type = c("tradeoffs", "cutoffs"), diagonal = FALSE, stat = MachineShop::settings("stat.Curve"), ... )

# S3 method for Resamples plot( x, metrics = NULL, stat = MachineShop::settings("stat.Resamples"), type = c("boxplot", "density", "errorbar", "violin"), ... )

# S3 method for VarImp plot(x, n = NULL, ...)

Arguments

type

type of plot to construct.

se

logical indicating whether to include standard error bars.

...

arguments passed to other methods.

find

numeric true positive rate at which to display reference lines identifying the corresponding rates of positive predictions.

diagonal

logical indicating whether to include a diagonal reference line.

stat

function or character string naming a function to compute a summary statistic on resampled metrics for trained MLModel line plots and Resamples model ordering. For LiftCurve and PerformanceCurve classes, plots are of resampled metrics aggregated by the statistic if given or of resample-specific metrics if NULL.

metrics

vector of numeric indexes or character names of performance metrics to plot.

stats

vector of numeric indexes or character names of partial dependence summary statistics to plot.

n

number of most important variables to include in the plot [default: all].

Examples

Run this code
# NOT RUN {
## Requires prior installation of suggested package gbm to run

## Factor response example

fo <- Species ~ .
control <- CVControl()

gbm_fit <- fit(fo, data = iris, model = GBMModel, control = control)
plot(varimp(gbm_fit))

gbm_res1 <- resample(fo, iris, GBMModel(n.trees = 25), control)
gbm_res2 <- resample(fo, iris, GBMModel(n.trees = 50), control)
gbm_res3 <- resample(fo, iris, GBMModel(n.trees = 100), control)
plot(gbm_res3)

res <- c(GBM1 = gbm_res1, GBM2 = gbm_res2, GBM3 = gbm_res3)
plot(res)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab