【发布时间】:2014-08-10 12:05:15
【问题描述】:
我正在尝试使用 HDFS 中的文件在 Mahout 上运行逻辑回归 - 文件的名称是 peng.txt,使用以下命令行。
mahout org.apache.mahout.classifier.sgd.TrainLogistic --passes 5 --rate 1 --lambda 0.5 --input peng.txt --features 21 --output test_mahout --target nbr_of_txns --categories 2 --predictors life_rev_usd_amt ntpv_12_mth_sent_usd_amt --types n n
此文件位于 HDFS 中,但是,除非我将文件复制到本地计算机,否则此行会出错并出现 File Not Found 异常。
我的 HADOOP_LOCAL 变量也设置为 null。我得到的错误如下 - 有没有人有解决这个问题的经验 - 如果有,请帮忙。
Exception in thread "main" java.io.FileNotFoundException: ppeng.txt (No such file or directory)**
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at org.apache.mahout.classifier.sgd.TrainLogistic.open(TrainLogistic.java:316)
at org.apache.mahout.classifier.sgd.TrainLogistic.mainToOutput(TrainLogistic.java:75)
at org.apache.mahout.classifier.sgd.TrainLogistic.main(TrainLogistic.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:197)
【问题讨论】: