【发布时间】:2018-07-08 10:10:10
【问题描述】:
我使用OptimalCutpoints 包来确定不平衡二元分类问题中概率预测的最佳切点。我选择NO 类作为健康类(大部分因变量是NO)。通过代码,我尝试提取最佳切点以平衡预测的敏感性和特异性。我的问题是,我是否应该假设模型预测的概率应该大于或小于最佳切点以将其分类为YES。这可能是一个简单的问题,但是,在我使用不同模型的数据集上,我观察到有时我通过使用 >= 和其他时间获得更好的结果。
optimal_cutpoint <- optimal.cutpoints(
X = "score",
status = "true",
tag.healthy = 'NO',
methods = "MaxSpSe",
data = data.frame(score = predict(model, df_train, type="prob")$YES
, true = df_train$y),
control = control.cutpoints()
)
optimal_cutpoint <- optimal_cutpoint$MaxSpSe$Global$optimal.cutoff$cutoff[1]
【问题讨论】:
标签: r machine-learning confusion-matrix