Learn R Programming

MachineShop (version 1.1.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 = mean,
  type = c("boxplot", "density", "errorbar", "violin"), ...)

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

# S3 method for MLModelTune plot(x, metrics = NULL, stat = 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 Lift plot(x, find = NULL, ...)

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

type

type of plot to construct.

...

arguments passed to other methods.

se

logical indicating whether to include standard error bars.

find

numeric percent of observed events at which to display reference lines indicating the corresponding percent tested in lift plots.

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