Wrapping up linear regression

Supervised Learning in R: Regression

Nina Zumel and John Mount

Win-Vector, LLC

Pros and Cons of Linear Regression

  • Pros
    • Easy to fit and to apply
    • Concise
    • Less prone to overfitting
Supervised Learning in R: Regression

Pros and Cons of Linear Regression

  • Pros
    • Easy to fit and to apply
    • Concise
    • Less prone to overfitting
    • Interpretable
Call:
lm(formula = blood_pressure ~ age + weight, data = bloodpressure)

Coefficients:
(Intercept)          age       weight  
    30.9941       0.8614       0.3349
Supervised Learning in R: Regression

Pros and Cons of Linear Regression

  • Pros
    • Easy to fit and to apply
    • Concise
    • Less prone to overfitting
    • Interpretable
  • Cons
    • Can only express linear and additive relationships
Supervised Learning in R: Regression

Collinearity

  • Collinearity -- when input variables are partially correlated.
Call:
lm(formula = blood_pressure ~ age + weight, data = bloodpressure)

Coefficients:
(Intercept)          age       weight  
    30.9941       0.8614       0.3349
Supervised Learning in R: Regression

Collinearity

  • Collinearity -- when variables are partially correlated.
  • Coefficients might change sign
Call:
lm(formula = blood_pressure ~ age + weight, data = bloodpressure)

Coefficients:
(Intercept)          age       weight  
    30.9941       0.8614       0.3349
Supervised Learning in R: Regression

Collinearity

  • Collinearity -- when variables are partially correlated.
  • Coefficients might change sign
  • High collinearity:
    • Coefficients (or standard errors) look too large
    • Model may be unstable
Call:
lm(formula = blood_pressure ~ age + weight, data = bloodpressure)

Coefficients:
(Intercept)          age       weight  
    30.9941       0.8614       0.3349
Supervised Learning in R: Regression

Coming Next

  • Evaluating a regression model
  • Properly training a model
Supervised Learning in R: Regression

Let's practice!

Supervised Learning in R: Regression

Preparing Video For Download...