首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏大模型系列

    机器学习经典算法:伯努利朴素贝叶斯(Bernoulli Naive Bayes)原理、手动计算与Python/Java双代码实战

    *;public class BernoulliNaiveBayes { private Map<String, Integer> vocab = new HashMap<>(); private double[]> condProb = new HashMap<>(); private int vocabSize; private double alpha; public BernoulliNaiveBayes Arrays.asList("免费", "会议") ); List<Integer> labels = Arrays.asList(1, 1, 0, 0, 1); BernoulliNaiveBayes nb = new BernoulliNaiveBayes(1.0); nb.fit(docs, labels); List<String> testDoc = Arrays.asList

    16720编辑于 2026-03-29
领券