Skip to content

Commit

Permalink
CR feedback, remove unecessary learners (came back during merge mista…
Browse files Browse the repository at this point in the history
…ke) and insert an empty line
  • Loading branch information
holdenk committed Apr 9, 2014
1 parent bb5fa56 commit 7ebe4d5
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.mllib.util

import java.io.File

import scala.math
import scala.util.Random

Expand Down Expand Up @@ -120,24 +121,6 @@ class MLUtilsSuite extends FunSuite with LocalSparkContext {
}
}

// This learner always says everything is 0
def terribleLearner(trainingData: RDD[LabeledPoint]): RegressionModel = {
object AlwaysZero extends RegressionModel {
override def predict(testData: RDD[Array[Double]]): RDD[Double] = {
testData.map(_ => 0)
}
override def predict(testData: Array[Double]): Double = {
0
}
}
AlwaysZero
}

// Always returns its input
def exactLearner(trainingData: RDD[LabeledPoint]): RegressionModel = {
new LinearRegressionModel(Array(1.0), 0)
}

test("kFold") {
val data = sc.parallelize(1 to 100, 2)
val collectedData = data.collect().sorted
Expand Down

0 comments on commit 7ebe4d5

Please sign in to comment.