Creates a measure for non-standard misclassification costs.
Source:R/Measure_make_cost.R
makeCostMeasure.Rd
Creates a cost measure for non-standard classification error costs.
Usage
makeCostMeasure(
id = "costs",
minimize = TRUE,
costs,
combine = mean,
best = NULL,
worst = NULL,
name = id,
note = ""
)
Arguments
- id
(
character(1)
)
Name of measure. Default is “costs”.- minimize
(
logical(1)
)
Should the measure be minimized? Otherwise you are effectively specifying a benefits matrix. Default isTRUE
.- costs
(matrix)
Matrix of misclassification costs. Rows and columns have to be named with class labels, order does not matter. Rows indicate true classes, columns predicted classes.- combine
(
function
)
How to combine costs over all cases for a SINGLE test set? Note this is not the same as theaggregate
argument in makeMeasure You can set this as well via setAggregation, as for any measure. Default is mean.- best
(
numeric(1)
)
Best obtainable value for measure. Default is -Inf
orInf
, depending onminimize
.- worst
(
numeric(1)
)
Worst obtainable value for measure. Default isInf
or -Inf
, depending onminimize
.- name
(character)
Name of the measure. Default isid
.- note
(character)
Description and additional notes for the measure. Default is “”.
See also
Other performance:
ConfusionMatrix
,
calculateConfusionMatrix()
,
calculateROCMeasures()
,
estimateRelativeOverfitting()
,
makeCustomResampledMeasure()
,
makeMeasure()
,
measures
,
performance()
,
setAggregation()
,
setMeasurePars()