Naïve Bayes execution error using Spark

Asked

Viewed 29 times

0

When I change the input file (by default: sample_svm_data.txt), on the other also containing numerical 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 being executed using the Apache Spark, just like this one example, the only change being the input file.

1 answer

1

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

You can check both 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.