为什么在GaussianNB [scikit-learn]中使用对数概率估计? [英] Why use log-probability estimates in GaussianNB [scikit-learn]?

查看:163
本文介绍了为什么在GaussianNB [scikit-learn]中使用对数概率估计?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用scikit-learn的 GaussianNB 软件包.

I'm currently using scikit-learn's GaussianNB package.

我注意到我可以选择以几种不同的方式返回分类的结果.返回分类的一种方法是使用predict_log_proba方法.

I've noticed that I can choose to return results for the classification several different ways. One way to return a classification is using the predict_log_proba method.

为什么我会选择使用predict_log_proba与predict_proba与predict?

Why would I choose to use predict_log_proba versus predict_proba versus predict?

推荐答案

  • 预测只是为您提供每个示例的课程
  • predict_proba 为您提供每个班级的概率,而 predict 只是参加最大概率的班级
  • predict_log_proba 为您提供了概率的对数,这通常更方便,因为概率会变得非常非常小
    • predict just gives you the class for every example
    • predict_proba gives you the probability for every class, and predict is just taking the class which maximal probability
    • predict_log_proba gives you the logarithm of the probabilities, this is often handier as probabilities can become very, very small
    • 这篇关于为什么在GaussianNB [scikit-learn]中使用对数概率估计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆