Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
CR feedback, remove unecessary learners (came back during merge mista…
…ke) and insert an empty line
  • Loading branch information
holdenk committed Apr 9, 2014
commit 7ebe4d571eee2ec11b6d30e9d76e73342a64e1e1
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insert an empty line between java imports and scala imports

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