Created
January 29, 2019 15:34
-
-
Save pedroduartecosta/5645e78a4c2281d53f46cb33e2dd6c58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val holdout = model.transform(test).select("prediction", "DelayOutputVar") | |
val rm = new RegressionMetrics(holdout.rdd.map(x => | |
(x(0).asInstanceOf[Double], x(1).asInstanceOf[Double]))) | |
println("sqrt(MSE): " + Math.sqrt(rm.meanSquaredError)) | |
println("mean absolute error: " + rm.meanAbsoluteError) | |
println("R Squared: " + rm.r2) | |
println("Explained Variance: " + rm.explainedVariance + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment