我有一个包含两列的数据框:score1
which isnumeric
和truth1
which is boolean
。我想预测truth1
使用score1
. 为此,我需要一个简单的线性模型,然后要求一个好的阈值,即在我的 ROC 曲线中给我 75%灵敏度的阈值。因此,我这样做:
roc_curve = roc(truth1 ~ score1 , data = my_data)
coords(roc=roc_curve, x = 0.75, input='sensitivity', ret='threshold')
我的问题是坐标返回“NA”,因为 ROC 曲线中没有出现 0.75 的灵敏度。所以这是我的问题:我怎样才能获得灵敏度至少为 0.75 且具有最大特异性的阈值?