update.trainOcc: Update or Re-fit a Model

Description Usage Arguments Details Value Examples

Description

Over-write the tuning parameter selection process. You can also calculate new performance metrics given the hold-out predictions are stored in object.

Usage

1
2
3
4
5
## S3 method for class 'trainOcc'
update(object, modParam = NULL, modRow = NULL,
  modRank = NULL, metric = NULL, puSummaryFunction = NULL,
  aggregatePredictions = FALSE, newMetricsOnly = FALSE,
  allowParallel = TRUE, verbose = FALSE, ...)

Arguments

object

a object of class trainOcc.

modParam

a data frame with the desired model parameters, or

modRow

the index of the model, i.e. the row in the object$results table, or

modRank

the model at the modRank-th position after sorting metric a performance metric (can be specified via argumetn metric).

metric

The metric used to select the model, e.g. in conjunction with modRank or new summary functions. if NULL the metric in object$metric is used.

puSummaryFunction

a function that can be passed to the summaryFunction argument of trainControl. This updates the trainOcc$results data frame with the new metric(s) returned from the function. (Only be done when hold-out predictions are stored in object.)

aggregatePredictions

The default is FALSE, which means that the performance metric is calculated for each set of hold-out predictions and the metrics are then aggregated. The mean and the standard deviation is returned in the object$results table. If TRUE the hold-out predictions are first aggregated and the puSummaryFunction is calculated once. Of course, no standard deviation of the performance metric can be calculated. Metrics calculated this way get the suffix AP in the object$results table.

newMetricsOnly

logical with default set to FALSE. Set to TRUE if the metrics already contained in the results table should be removed.

allowParallel

if true and if a parallel backend is registered the calcualtions are run parallel

verbose

A logical for printing information about the updated model.

...

other arguments that can be passed to update.train

Details

update.train

Value

an updated trainOcc object.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data(bananas)

tocc <- trainOcc(x=bananas$tr[, -1], y=bananas$tr[, 1], method="ocsvm")

## update to the highest ranked model according to metric puAuc
tocc <- update(tocc, modRank=1, metric="puAuc")

## End(Not run)

benmack/oneClass documentation built on Dec. 15, 2020, 7:38 p.m.