计算一致性相关系数。
用法
ccc(data, ...)
# S3 method for data.frame
ccc(
data,
truth,
estimate,
bias = FALSE,
na_rm = TRUE,
case_weights = NULL,
...
)
ccc_vec(truth, estimate, bias = FALSE, na_rm = TRUE, case_weights = NULL, ...)
参数
- data
-
data.frame包含由truth和estimate参数指定的列。 - ...
-
目前未使用。
- truth
-
真实结果的列标识符(即
numeric)。这应该是一个不带引号的列名,尽管此参数是通过表达式传递的并且支持quasiquotation(您可以不带引号的列名)。对于_vec()函数,一个numeric向量。 - estimate
-
预测结果的列标识符(也是
numeric)。与truth一样,可以通过不同的方式指定,但主要方法是使用不带引号的变量名称。对于_vec()函数,一个numeric向量。 - bias
-
logical;是否应该使用方差的有偏估计(如 Lin (1989))? - na_rm
-
logical值,指示在计算继续之前是否应剥离NA值。 - case_weights
-
案例权重的可选列标识符。这应该是一个不带引号的列名称,其计算结果为
data中的数字列。对于_vec()函数,一个数值向量。
值
tibble 包含列 .metric 、 .estimator 和 .estimate 以及 1 行值。
对于分组 DataFrame ,返回的行数将与组数相同。
对于 ccc_vec() ,单个 numeric 值(或 NA )。
参考
林L.(1989)。用于评估再现性的一致性相关系数。生物识别,45 (1), 255-268。
尼克森,C. (1997)。关于“评估再现性的一致性相关系数”的注释。生物识别学,53(4), 1503-1507。
也可以看看
其他数字指标:huber_loss_pseudo() , huber_loss() , iic() , mae() , mape() , mase() , mpe() , msd() , poisson_log_loss() , rmse() , rpd() , rpiq() , rsq_trad() , rsq() , smape()
其他一致性指标:rpd()、rpiq()、rsq_trad()、rsq()
其他准确度指标:huber_loss_pseudo() , huber_loss() , iic() , mae() , mape() , mase() , mpe() , msd() , poisson_log_loss() , rmse() , smape()
例子
# Supply truth and predictions as bare column names
ccc(solubility_test, solubility, prediction)
#> # A tibble: 1 × 3
#> .metric .estimator .estimate
#> <chr> <chr> <dbl>
#> 1 ccc standard 0.937
library(dplyr)
set.seed(1234)
size <- 100
times <- 10
# create 10 resamples
solubility_resampled <- bind_rows(
replicate(
n = times,
expr = sample_n(solubility_test, size, replace = TRUE),
simplify = FALSE
),
.id = "resample"
)
# Compute the metric by group
metric_results <- solubility_resampled %>%
group_by(resample) %>%
ccc(solubility, prediction)
metric_results
#> # A tibble: 10 × 4
#> resample .metric .estimator .estimate
#> <chr> <chr> <chr> <dbl>
#> 1 1 ccc standard 0.935
#> 2 10 ccc standard 0.937
#> 3 2 ccc standard 0.943
#> 4 3 ccc standard 0.956
#> 5 4 ccc standard 0.944
#> 6 5 ccc standard 0.925
#> 7 6 ccc standard 0.933
#> 8 7 ccc standard 0.922
#> 9 8 ccc standard 0.955
#> 10 9 ccc standard 0.940
# Resampled mean estimate
metric_results %>%
summarise(avg_estimate = mean(.estimate))
#> # A tibble: 1 × 1
#> avg_estimate
#> <dbl>
#> 1 0.939
相关用法
- R yardstick conf_mat 分类数据的混淆矩阵
- R yardstick classification_cost 不良分类的成本函数
- R yardstick pr_auc 查准率曲线下面积
- R yardstick accuracy 准确性
- R yardstick gain_capture 增益捕获
- R yardstick pr_curve 精确率召回曲线
- R yardstick mn_log_loss 多项数据的平均对数损失
- R yardstick rpd 性能与偏差之比
- R yardstick mae 平均绝对误差
- R yardstick detection_prevalence 检测率
- R yardstick bal_accuracy 平衡的精度
- R yardstick rpiq 绩效与四分位间的比率
- R yardstick roc_aunp 使用先验类别分布,每个类别相对于其他类别的 ROC 曲线下面积
- R yardstick roc_curve 接收者算子曲线
- R yardstick rsq R 平方
- R yardstick msd 平均符号偏差
- R yardstick mpe 平均百分比误差
- R yardstick iic 相关性理想指数
- R yardstick recall 记起
- R yardstick roc_aunu 使用均匀类别分布,每个类别相对于其他类别的 ROC 曲线下面积
- R yardstick npv 阴性预测值
- R yardstick rmse 均方根误差
- R yardstick sens 灵敏度
- R yardstick rsq_trad R 平方 - 传统
- R yardstick poisson_log_loss 泊松数据的平均对数损失
注:本文由纯净天空筛选整理自Max Kuhn等大神的英文原创作品 Concordance correlation coefficient。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
