keepSize: Filter for Size

Description Usage Arguments Value See Also Examples

View source: R/keepSize.R

Description

Filters the Subcascades object for cascades of the given sizes.

Usage

1

Arguments

subcascades

A Subcascades object as it is returned by subcascades-function. The Subcascades object is made up of a list of matrices. Each matrix comprises the evaluation results of cascades of a specific length and is sorted row-wise according to the achieved minimal classwise sensitivities of the cascades (decreasing). The rownames show the class order by a character string of type '1>2>3' and the entries the sensitivity for each position of the cascade.

size

A numeric value that defines the size of the cascades that should be returned. The smallest size is 2 and the largest the maximal number of classes of the current dataset.

Value

A Subcascades object as in subcascades, that only includes cascades of specific lengths.

See Also

dropSize, dropSets, keepSets, dropThreshold, keepThreshold

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(TunePareto)
data(esl)
data = esl$data
labels = esl$labels
foldList = generateCVRuns(labels  = labels,
                          ntimes      = 2,
                          nfold       = 2,
                          leaveOneOut = FALSE,
                          stratified  = TRUE)
predMap = predictionMap(data, labels, foldList = foldList, 
                       classifier = tunePareto.svm(), kernel='linear')
# generate Subcascades object
subc = subcascades(predMap,thresh=0.7)

# filters for cascades that have a length of 3
keepSize(subc,size=3)
# filters for cascades that have a length of 3 or 4
keepSize(subc, size=c(3,4))

ORION documentation built on Feb. 7, 2022, 5:15 p.m.