Skip to content

Instantly share code, notes, and snippets.

val prices = quotesFileLines.map { _.split(",").toList(5).toDouble }
val quotesFileLines = Source.fromFile("...your...path...").getLines.toList
val sparkConfig = new SparkConf().setAppName("quotes").setMaster("local")
val sparkContext = new SparkContext(sparkConfig)
import org.apache.spark.mllib.regression.{ RidgeRegressionWithSGD, LabeledPoint }
import org.apache.spark.{ SparkConf, SparkContext }
import org.apache.spark.mllib.linalg.Vectors
import scala.io.Source
@krro
krro / Main.scala
Created September 13, 2015 07:49
import org.apache.spark.mllib.regression.{ RidgeRegressionWithSGD, LabeledPoint }
import org.apache.spark.{ SparkConf, SparkContext }
import org.apache.spark.mllib.linalg.Vectors
import scala.io.Source
object Main extends App {
val sparkConfig = new SparkConf().setAppName("quotes").setMaster("local")
val sparkContext = new SparkContext(sparkConfig)
val quotesFileLines = Source.fromFile("...your...path...").getLines.toList
import org.apache.spark.mllib.regression.{ RidgeRegressionWithSGD, LabeledPoint }
import org.apache.spark.{ SparkConf, SparkContext }
import org.apache.spark.mllib.linalg.Vectors
import scala.io.Source
object Main extends App {
val sparkConfig = new SparkConf().setAppName("quotes").setMaster("local")
val sparkContext = new SparkContext(sparkConfig)
val quotesFileLines = Source.fromFile("...your...path...").getLines.toList