I'm learning Spark(Pyspark) and while trying to import MLLIB libraries, I came across this strange error that MulticlassClassificationEvaluator cannot be imported:
from pyspark.ml import Pipeline
from pyspark.ml.classification import DecisionTreeClassifier
from pyspark.ml.feature import StringIndexer, VectorIndexer
from pyspark.mllib.util import MLUtils
from pyspark.ml.evaluation import MulticlassClassificationEvaluator
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-148-0033401bce6e> in <module>()
4 from pyspark.mllib.util import MLUtils
----> 5 from pyspark.ml.evaluation import MulticlassClassificationEvaluator
ImportError: cannot import name MulticlassClassificationEvaluator
I found out the problem. I was using spark-1.4.0 which obviously has no implementation of MulticlassClassificationEvaluator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With