class_pred: Create a class prediction object

Description Usage Arguments Details Examples

View source: R/class-pred.R

Description

class_pred() creates a class_pred object from a factor or ordered factor. You can optionally specify values of the factor to be set as equivocal.

Usage

1
class_pred(x = factor(), which = integer(), equivocal = "[EQ]")

Arguments

x

A factor or ordered factor.

which

An integer vector specifying the locations of x to declare as equivocal.

equivocal

A single character specifying the equivocal label used when printing.

Details

Equivocal values are those that you feel unsure about, and would like to exclude from performance calculations or other metrics.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- factor(c("Yes", "No", "Yes", "Yes"))

# Create a class_pred object from a factor
class_pred(x)

# Say you aren't sure about that 2nd "Yes" value. You could mark it as
# equivocal.
class_pred(x, which = 3)

# Maybe you want a different equivocal label
class_pred(x, which = 3, equivocal = "eq_value")

probably documentation built on July 1, 2020, 7:08 p.m.