MLUtils.loadLibSVMFile()抛出java.lang.NumberFormatException:对于输入字符串:" 1"

时间:2018-02-07 12:10:52

标签: java scala apache-spark

我已经确认这不是一个重复的问题(伊莱亚!)

我尝试读取格式正确的LibSVMFile。

The following code 'MLUtils.loadLibSVMFile(sc, "testdata.txt")' is throwing java.lang.NumberFormatException: For input string: "1" 

输入文件的第一行失败。第一行是:

1 128:51 129:159 130:253 131:159 132:50 155:48 156:238 157:252 158:252 159:252 ....

我查看了以下链接,但他们没有解决此问题: How can I read LIBSVM models (saved using LIBSVM) into PySpark? http://apache-spark-user-list.1001560.n3.nabble.com/MLLib-LIBSVM-issue-td14507.html

0 个答案:

没有答案