modelPosition: Get parameter(s), result table row and rank of a model.

Description Usage Arguments Value Examples

View source: R/modelPosition.R

Description

Given the parameter(s), results table row, or rank of a particular metric of the results table, the corresponding two informations are extracted.

Usage

1
2
modelPosition(x, modParam = NULL, modRow = NULL, modRank = NULL,
  by = NULL, decreasing = TRUE)

Arguments

x

an object as returned from train.

modParam

data frame with the parameters of the model.

modRow

the row or index of the model in the model-selection table.

modRank

the rank of the model after sorting by by.

by

a character or character vector specifying by which column of the x$results table to sort. If NULL the performance metric is taken from the train object.

decreasing

only when modRank is used. TRUE (default) to sort in decreasing order. can be a vector if by is a vector.

Value

a list with the parameter, row index and rank of the model.

Examples

1
2
3
4
5
6
7
8
data(bananas)
oc <- trainOcc(x = bananas$tr[, -1], y = bananas$tr[, 1], 
               tuneGrid=expand.grid(sigma=c(.1, 1), 
                                    cNeg=c(0.1, 1), 
                                    cMultiplier=c(10, 100)))
## get the position (in the results table) and parameters of model which is 
## on rank 3 according to the performance metric \'puAuc\' 
mp3 <- modelPosition(oc, modRank=3, by="puAuc")

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