machine-learning - 朴素贝叶斯对训练观察的数量敏感吗?

标签 machine-learning naivebayes

我正在使用 Swift(即使我的问题与语言无关)和 Python 来测试我的 ML 逻辑。我有训练数据:

("add a new balloon", "add-balloon")
("add a balloon", "add-balloon")
("get last balloon", "get-balloon")
("update balloon color to red", "update-balloon")

当我尝试使用朴素贝叶斯对新句子进行分类时,例如

classify("could you add a new balloon") 
// Return add-balloon
classify("could you update the balloon color") 
// Return add-balloon
classify("update the balloon color") 
// Return add-balloon

我的数据集有很多关于添加气球的观察结果(大约 50 个),但需要更新或获取的观察结果并不多(大约 5-6 个)。朴素贝叶斯对训练观察的数量敏感吗?我不明白为什么即使给出了训练期间看到的句子,分类也表现不佳。

最佳答案

朴素贝叶斯对类先验(类之间的示例分布)很敏感。因此,如果您的 add-balloon 数量多于其他类别,那么它就会偏向此类。它通常很有帮助,因为假设您什么都不知道(没有后验信息),您最好的选择是尝试最有可能的类(class)。

如果您的分布严重倾斜,您的数据集不大,您的文档很短或缺乏信息丰富的单词(或包含许多模糊的单词),那么这可能会导致不期望的结果,例如您所报告的结果。

关于machine-learning - 朴素贝叶斯对训练观察的数量敏感吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42791002/

相关文章:

image-processing - 使用机器学习创建植物健康分类器

tensorflow - reshape 层的输出维度

python - 在 scikit-learn 中实现 K 邻居分类器,每个对象具有 3 个特征

machine-learning - 分类监督训练困惑

ruby - Ruby 中的朴素贝叶斯

python - 无法在朴素贝叶斯中训练模型

Python贝叶斯心脏预测,结果不准确

machine-learning - 如何在 Torch 的 GPU 上将张量的元素限制/舍入到小数点后 4 位?

python - 如何将 wav 音频数据集加载到 TensorFlow 中

Python + Scikit-learn :How to plot the curves of training score and validation score against the additive smoothing parameter alpha