當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R probably as_class_pred 強製轉換為 class_pred 對象

as_class_pred() 提供從其他現有對象到 class_pred 的強製。

用法

as_class_pred(x, which = integer(), equivocal = "[EQ]")

參數

x

因子或有序因子。

which

一個整數向量,指定要聲明為模棱兩可的 x 的位置。

equivocal

指定打印時使用的不明確標簽的單個字符。

例子


x <- factor(c("Yes", "No", "Yes", "Yes"))
as_class_pred(x)
#> [1] Yes No  Yes Yes
#> Levels: No Yes
#> Reportable: 100%

源代碼:R/class-pred.R

相關用法


注:本文由純淨天空篩選整理自Max Kuhn等大神的英文原創作品 Coerce to a class_pred object。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。