我有一个关于Mahout的问题:当我用互补模型和standart模型方法测试我训练过的朴素贝叶斯模型时,为什么我在混淆矩阵中得到相同的测试结果(相同的模型测试精度-- 80%)?
以下是我使用的步骤:
# mahout seq2sparse --input /user/root/data-seq/chunk-0 --output /user/root/vectors -ow -wt tfidf -md 2 -x 95 -n 2 -nr 2# mahout split --input data-vectors/tfidf-vectors --trainingOutput training-vectors --testOutput test-vectors --randomSelectionPct 30 --overwrite --sequenceFiles -xm sequentialComplementaryNaiveBayesClassifier: # mahout trainnb -i training-vectors -el -li labelindex -o model -ow -c b) StandardNaiveBayesClassifier: # mahout trainnb -i training-vectors -el -li labelindex -o model -owComplementaryNaiveBayesClassifier: # mahout testnb -i training-vectors -m model -l labelindex -ow -o tweets-testing -c b) StandardNaiveBayesClassifier: # mahout testnb -i training-vectors -m model -l labelindex -ow -o tweets-testing也许是因为标准朴素贝叶斯不使用权重归一化,但我在第一步使用它设置参数:-n 2?如果是真的,就意味着如果我想比较这些算法的性能,就不应该在创建向量时使用这个参数。
发布于 2014-05-20 02:25:35
您所指的用于mahout seq2sparse的mahout seq2sparse2选项实际上是指定用于length normalization1的L_p规范。因此,mahout seq2sparse ... -n 2使用L_2长度归一化的TF-以色列国防军载体.或者,您可以使用-lnorm进行日志规范化。这是用于补码和标准朴素Bayes2之前的预处理步骤的一部分。
重量归一化与长度归一化不同,在Mahout 0.7中不使用。
在即将发布的1.0版本中使用了权重规范化,因此为了获得标准和补充朴素贝叶斯的最佳比较,您应该签出并构建一个最新主干的副本:http://mahout.apache.org/developers/buildingmahout.html。
如果升级到最新的主干,您应该会看到标准和补足朴素贝叶斯之间的显著差异。
1个mahout.apache.org/users/basics/creating-vectors-from-text.html
2
https://stackoverflow.com/questions/23676093
复制相似问题