我正在尝试从spark教程中启动示例,但我无法编译:
final LinearRegressionModel model =
LinearRegressionWithSGD.train(JavaRDD.toRDD(parsedData),numIterations, stepSize);
我找不到LinearRegressionWithSGD
的maven依赖和导入包。这个不起作用:
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>2.1.0</version>
我应该选哪个?
答案 0 :(得分:2)
您应该使用spark-mllib
库:
<!-- https://mvnrepository.com/artifact/org.apache.spark/spark-mllib_2.10 -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.10</artifactId>
<version>2.1.0</version>
</dependency>