O'Reilly logo

Mastering Machine Learning with R - Second Edition by Cory Lesmeister

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

Regression analysis

To do this part of the process, we will repeat the steps and code from Chapter 2, Linear Regression - The Blocking and Tackling of Machine Learning. If you haven't done so, please look at Chapter 2, Linear Regression - The Blocking and Tackling of Machine Learning for some insight on how to interpret the following output.

We will use the following lm() function to create our linear model with all the factors as inputs and then summarize the results:

    > nhl.lm <- lm(ppg ~ ., data = pca.scores)    > summary(nhl.lm)    Call:    lm(formula = ppg ~ ., data = pca.scores)    Residuals:          Min        1Q   Median       3Q      Max     -0.163274 -0.048189 0.003718 0.038723 0.165905     Coefficients:          Estimate       Std. Error t value Pr(>|t|)  (Intercept) 1.111333 0.015752 70.551 ...

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