【问题标题】:the way to tune the threshold for the predict method in sklearn.ensemble.GradientBoostingClassifier调整 sklearn.ensemble.GradientBoostingClassifier 中预测方法阈值的方法
【发布时间】:2019-03-18 14:18:29
【问题描述】:

我正在使用 scikit-learn (sklearn.ensemble.GradientBoostingClassifier) 中实现的梯度提升分类器来解决二进制分类问题。虽然默认提供了 predict 方法,但官方文档中没有显示任何线索:

  1. 默认阈值是如何定义的,

  2. 在调优模型期间是否有自定义方法来修改此阈值

欢迎任何线索和建议

非常感谢

【问题讨论】:

    标签: python scikit-learn classification


    【解决方案1】:

    至于1,我认为是0.5

    至于2,当我使用sklearn库时,我使用了predict_proba,然后你可以自己阈值
    http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html#sklearn.ensemble.GradientBoostingClassifier.predict_proba
    (这样你也可以通过比较来检查默认阈值是多少)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-22
      • 2012-07-07
      • 1970-01-01
      • 2018-09-03
      • 1970-01-01
      • 1970-01-01
      • 2021-09-20
      • 2017-08-14
      相关资源
      最近更新 更多