Chapter 7. Supervised Learning with MLlib – Regression

This chapter is divided into the following recipes:

  • Using linear regression
  • Understanding the cost function
  • Doing linear regression with lasso
  • Doing ridge regression

Introduction

The following is Wikipedia's definition of supervised learning:

"Supervised learning is the machine learning task of inferring a function from labeled training data."

Supervised learning has two steps:

  • Train the algorithm with training dataset; it is like giving questions and their answers first
  • Use test dataset to ask another set of questions to the trained algorithm

There are two types of supervised learning algorithms:

  • Regression: This predicts continuous value output, such as house price.
  • Classification: This predicts discreet ...

Get Spark 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.