LinearRegressionModel的maven存储库

时间:2017-03-24 14:14:16

标签: maven apache-spark apache-spark-mllib

我正在尝试从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>

我应该选哪个?

1 个答案:

答案 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>