Skip to content

Commit

Permalink
Small style update to DecisionTreeSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbradley committed Aug 1, 2014
1 parent db0eab2 commit 4801b40
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class DecisionTreeSuite extends FunSuite with LocalSparkContext {
requiredMSE: Double) {
val predictions = input.map(x => model.predict(x.features))
val squaredError = predictions.zip(input).map { case (prediction, expected) =>
(prediction - expected.label) * (prediction - expected.label)
val err = prediction - expected.label
err * err
}.sum
val mse = squaredError / input.length
assert(mse <= requiredMSE)
Expand Down

0 comments on commit 4801b40

Please sign in to comment.