O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mean Absolute Error

MAE is the average of the absolute differences between the predicted and actual targets and is given as follows:

MAE is similar in principle to MSE, but it does not punish large deviations as much.

Our function to compute MAE is as follows:

Scala def absError(actual:Double, pred: Double) : Double = {   return Math.abs( (pred - actual)) } 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required