例如,我训练了贝叶斯(SVM,RandomForest或其他)模型,得分低于:
Model:
precision recall f1-score support
neg 0.0622 0.9267 0.1166 191
pos 0.9986 0.7890 0.8815 12647
avg / total 0.98 0.79 0.87 12838
我的老板告诉我neg
的精确度太低,他可以接受60%的召回,不需要那么高。所以我需要一种方法来通过将召回限制在60%来获得最佳精度。但是我没有在sklearn中找到类似的功能。
有没有办法训练最佳precision
的模型,而召回可以限制在特定值? (或者neg
达到20%的精确度,不要在意回忆)
答案 0 :(得分:1)
sklearn实现精确回忆权衡如下:http://scikit-learn.org/stable/auto_examples/model_selection/plot_precision_recall.html
一种方法是使用precision_recall_curve()
,然后在图表上找到您想要的召回点。