Regression model evaluation using Spark 2.0

In this recipe, we explore how to evaluate a regression model (a regression decision tree in this example). Spark provides the RegressionMetrics facility which has basic statistical facilities such as Mean Squared Error (MSE), R-Squared, and so on, right out of the box.

The objective in this recipe is to understand the evaluation metrics provided by Spark out of the box. It is best to concentrate on step 8 since we cover regression in more detail in Chapter 5Practical Machine Learning with Regression and Classification in Spark 2.0 - Part I and Chapter 6, Practical Machine Learning with Regression and Classification in Spark 2.0 - Part II and throughout the book.

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.