Error in confusionMatrix,default(as.factor(y pred label)reference = as.factorly label): The data must contain some levels that overlap the reference…

图片[1]-Error in confusionMatrix,default(as.factor(y pred label)reference = as.factorly label): The data must contain some levels that overlap the reference…-决策链社区论坛

【报错原因】

DCA绘图里:
y_pred_label <- as.numeric(y_pred_score > thresh)
cm <- confusionMatrix(as.factor(y_pred_label), reference = as.factor(y_label))$table

【解决方法】

这样必须是0-1标签了,字符串类别出现问题

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容