Error in running Naïve Bayes using Spark

0

When I change the input file (by default: sample_svm_data.txt ), on the other hand also containing numeric attributes separated by spaces, the following error occurs:

File "/usr/local/spark/python/lib/pyspark.zip/pyspark/mllib/util.py", line 53, in _parse_libsvm_line     index, value = items [1 + i] .split (":") ValueError: need more than 1 value to unpack

What can it be?

The algorithm in python is running using Apache Spark , just like this example , the only change being the input file.

    
asked by anonymous 12.11.2017 / 21:38

1 answer

1

The error message found indicates that within the library, a value was expected to contain ":" when it does not contain. (The message is not explicit, why the code did not really expect this, but look at the line of code: it makes a .split(":") and tries to assign the result to two parameters on the left side. returns only one value)

You can check the two files and see if in any of the columns the data has ":" in the original file?

It may even be that the data is separated by ":" instead of spaces.

    
14.11.2017 / 14:53