导入 MulticlassClassificationEvaluator 时出错
Error importing MulticlassClassificationEvaluator
我正在学习 Spark(Pyspark),在尝试导入 MLLIB 库时,遇到了无法导入 MulticlassClassificationEvaluator 的奇怪错误:
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
我发现了问题。我使用的是 spark-1.4.0,它显然没有实现 MulticlassClassificationEvaluator。
我正在学习 Spark(Pyspark),在尝试导入 MLLIB 库时,遇到了无法导入 MulticlassClassificationEvaluator 的奇怪错误:
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
我发现了问题。我使用的是 spark-1.4.0,它显然没有实现 MulticlassClassificationEvaluator。