Univariate linear regression

Univariate (or single-variable) linear regression refers to a linear regression model where we use only one independent variable x to learn a linear function that maps x to our dependent variable y:

In the preceding equation, we have the following:

  • yi represents the dependent variable (cnt) for the ith observation
  • xi represents the single independent variable for the ith observation
  • εi represents the error term for the ith observation
  • β0 is the intercept coefficient
  • β1 is the regression coefficient for the single independent variable

Since, in general form, a univariate linear regression model is a linear function, ...

Get Machine Learning with Apache Spark Quick Start Guide 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.