2017-03-24 211 views
0

我試圖從推出火花教程樣品,我不能得到這個編譯:Maven倉庫爲LinearRegressionModel

final LinearRegressionModel model = 
      LinearRegressionWithSGD.train(JavaRDD.toRDD(parsedData),numIterations, stepSize); 

我找不到Maven的依賴和進口包LinearRegressionWithSGD。這一個不起作用:

 <groupId>org.apache.spark</groupId> 
     <artifactId>spark-core_2.10</artifactId> 
     <version>2.1.0</version> 

我應該採取哪一種?

回答

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>