Used in bag_treer()
.
Usage
class_cost(range = c(0, 5), trans = NULL)
Arguments
- range
A two-element vector holding the defaults for the smallest and largest possible values, respectively.
- trans
A
trans
object from thescales
package, such asscales::log10_trans()
orscales::reciprocal_trans()
. If not provided, the default is used which matches the units used inrange
. If no transformation,NULL
.
Details
This parameter reflects the cost of a misclassified sample relative to a baseline cost of 1.0. For example, if the first level of an outcome factor occurred rarely, it might help if this parameter were set to values greater than 1.0. If the second level of the outcome factor is in the minority, values less than 1.0 would cause the model to emphasize the minority class more than the majority class.