Create a class prediction objectSource:
class_pred() creates a
class_pred object from a factor or ordered
factor. You can optionally specify values of the factor to be set
A factor or ordered factor.
An integer vector specifying the locations of
xto declare as equivocal.
A single character specifying the equivocal label used when printing.
Equivocal values are those that you feel unsure about, and would like to exclude from performance calculations or other metrics.
x <- factor(c("Yes", "No", "Yes", "Yes")) # Create a class_pred object from a factor class_pred(x) #>  Yes No Yes Yes #> Levels: No Yes #> Reportable: 100% # Say you aren't sure about that 2nd "Yes" value. You could mark it as # equivocal. class_pred(x, which = 3) #>  Yes No [EQ] Yes #> Levels: No Yes #> Reportable: 75% # Maybe you want a different equivocal label class_pred(x, which = 3, equivocal = "eq_value") #>  Yes No eq_value Yes #> Levels: No Yes #> Reportable: 75%