object ml不是包org.apache.spark的成员

时间:2017-09-03 15:40:53

标签: apache-spark sbt apache-spark-mllib

我试图在Mllib中迈出第一步。我的库依赖项是:

libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.2.0"
libraryDependencies += "com.github.fommil.netlib" % "all" % "1.1.2"

但我仍然得到:

Error:(4, 27) object ml is not a member of package org.apache.spark
  import org.apache.spark.ml.regression.GeneralizedLinearRegression

1 个答案:

答案 0 :(得分:5)

您已经包含了对Spark Core的依赖,您还应该添加Spark MLLib:

libraryDependencies += "org.apache.spark" % "spark-mllib_2.11" % "2.2.0"

或更简单:

libraryDependencies += "org.apache.spark" %% "spark-mllib" % "2.2.0"