plotLearningCurves: Utility function to plot learning curves of multiple models.

Description Usage Arguments Examples

Description

- Comparison helps determine if models contain bias or variance - Ideally want low training error and good generalization - Basic algorithm: split original data at different ratios - Re-train passed-in models on each split, and capture the error rate for both the train and valid data-sets. - NOTE: CV error is evaluated on _entire_ CV set, not subset - Plot the error (the score) versus the dataset size

Usage

1
plotLearningCurves(models, labels, metric, ctrlFn, cv, colors, seed = 1)

Arguments

models

List - List of model objects.

labels

List - *Optional* List of labels associated with models

metric

String - Metric models were trained with

cv

Data - Cross-validation data set (containing predictor)

colors

List - *Optional* List of colors associated with models

seed

Number - Seed to use for training each model

Examples

1
2
3
4
5
6
7
8
9
plotLearningCurves(
  models     = list(cfFit),
  metric     = "ROC",
  ctrlFn     = fitControl,
  cv         = valid,
  colors     = c("orange", "blue"),
  labels     = c("Glm Model 4", "Glm Model 6", "CForest"),
  seed       = SEED
)

andybeeching/discern documentation built on May 10, 2019, 11:44 a.m.