Learn R Programming

MachineShop (version 1.3.0)

plot: Model Performance Plots

Description

Plot measures of model performance and predictor variable importance.

Usage

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

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

# S3 method for MLModelTune plot(x, metrics = NULL, stat = base::mean, type = c("boxplot", "density", "errorbar", "line", "violin"), ...)

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

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

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

# S3 method for Curves plot(x, type = c("tradeoffs", "cutoffs"), diagonal = FALSE, stat = base::mean, ...)

# S3 method for Lift plot(x, find = NULL, diagonal = TRUE, stat = base::mean, ...)

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

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

Arguments

x

object to plot.

metrics

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

stat

function to compute a summary statistic on resampled values for MLModelTune line plots and Resamples model sorting. For Curves and Lift classes, plots are of resampled metrics aggregated by the statistic if given or of resample-specific metrics if NULL. Curves, or NULL for resample-specific metrics.

type

type of plot to construct.

...

arguments passed to other methods.

se

logical indicating whether to include standard error bars.

diagonal

logical indicating whether to include a diagonal reference line.

find

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

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].

See Also

performance, resample, diff, tune, calibration, confusion, lift, dependence, varimp

Examples

Run this code
# NOT RUN {
## Factor response example

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

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

gbmres1 <- resample(fo, iris, GBMModel(n.trees = 25), control)
gbmres2 <- resample(fo, iris, GBMModel(n.trees = 50), control)
gbmres3 <- resample(fo, iris, GBMModel(n.trees = 100), control)
plot(gbmres3)

res <- Resamples(GBM1 = gbmres1, GBM2 = gbmres2, GBM3 = gbmres3)
plot(res)

# }

Run the code above in your browser using DataLab