val data = sc.textFile("data/mllib/ridge-data/lpsa.data")
修改為:
val data = sc.textFile("/usr/lib/spark/data/mllib/ridge-data/lpsa.data")
當然,也要設定 master 為 local,如下所示:
val conf = new SparkConf().setAppName("LinearRegressionWithSGDExample").setMaster("local")
完成之後,進行 compile 可以得到以下結果:
$ sbt compile
[info] Loading project definition from /home/ubuntu/liRegression/project
[info] Loading settings for project liregression from build.sbt ...
[info] Set current project to liRegression (in build file:/home/ubuntu/liRegression/)
[info] Executing in batch mode. For better performance use sbt's shell
[info] Compiling 1 Scala source to /home/ubuntu/liRegression/target/scala-2.11/classes ...
[info] Done compiling.
[success] Total time: 6 s, completed Oct 30, 2018 8:12:08 AM