Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/scala/util/MLLRDemo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import org.apache.spark.SparkContext

object MLILRDemo {
def main(args: Array[String]) = {
val mc = new MLContext(new SparkContext("local[4]", "MLILRtest"))
val sc = new SparkContext("local[4]", "MLIRtest")
val mc = new MLContext(sc)

val data = mc.loadCsvFile(args(0))
val d2 = data.map((x: MLRow) => x.drop(0).+:(if(x(0).toString == "n07760859") MLValue(1.0) else MLValue(0.0))).cache()
Expand All @@ -16,5 +17,6 @@ object MLILRDemo {
//val model = SVMAlgorithm.train(d2)

println("Time to train: " + model.trainingTime)
sc.stop()
}
}