首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >创建mahout模型时出错

创建mahout模型时出错
EN

Stack Overflow用户
提问于 2013-01-04 13:59:02
回答 1查看 589关注 0票数 4

我正在为我的数据训练mahout分类器,遵循我发出的创建mahout模型的命令

代码语言:javascript
复制
./bin/mahout seqdirectory -i /tmp/mahout-work-root/MyData-all -o /tmp/mahout-work-root/MyData-seq

./bin/mahout seq2sparse -i /tmp/mahout-work-root/MyData-seq -o /tmp/mahout-work-root/MyData-vectors -lnorm -nv -wt tfidf

./bin/mahout split -i /tmp/mahout-work-root/MyData-vectors/tfidf-vectors --trainingOutput /tmp/mahout-work-root/MyData-train-vectors --testOutput /tmp/mahout-work-root/MyData-test-vectors --randomSelectionPct 40 --overwrite --sequenceFiles -xm sequential

./bin/mahout trainnb -i /tmp/mahout-work-root/Mydata-train-vectors -el -o /tmp/mahout-work-root/model -li /tmp/mahout-work-root/labelindex -ow

当我尝试使用trainnb命令创建模型时,我得到了以下异常:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 at org.apache.mahout.classifier.naivebayes.BayesUtils.writeLabelIndex(BayesUtils.java:119) at org.apache.mahout.classifier.naivebayes.training.TrainNaiveBayesJob.createLabelIndex(TrainNaiveBayesJob.java:152)

这里会有什么问题呢?

注意:原始示例提到的here运行良好。

EN

回答 1

Stack Overflow用户

发布于 2013-01-19 15:55:19

我认为这可能是你如何放置你的培训文件的问题。文件应按如下方式组织:

MyData-All

\classA

代码语言:javascript
复制
 -file1
 -file2
 -...

\classB

代码语言:javascript
复制
 -filex

……

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14151877

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档