Search code examples
apache-sparkpysparkmaprapache-spark-mllibapache-spark-ml

Failed to load class for data source: Libsvm in spark ML pyspark/scala


When I try to import a libsvm file in pyspark/scala using "sqlContext.read.format("libsvm").load", I get the following error -

"Failed to load class for data source: Libsvm."

At the same time, if I use "MLUtils.loadLibSVMFile" it works perfectly fine. I need to use both Spark ML (to get class probabilities) and MLlib for an evaluation. Have attached the error screenshot.

This is a MapR cluster. Spark version 1.5.2 Error


Solution

  • libsvm source format is available since version 1.6 of Spark.