O'Reilly logo

R Data Mining by Andrea Cirillo

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

Visualizing fitted values

To get a closer look at our model outputs, we have to take a closer look at the linear_regression_revenues object we have just created. What kind of object is it? How would you check this?

We can conveniently employ the mode() function for this:

mode(linear_regression_revenues)

This tells us that linear_regression_revenues is a list. And what is this list composed of? Just look at the str() output to find out:

str(linear_regression_revenues) List of 12 $ coefficients : Named num [1:2] 2.75 5.84e-08 ..- attr(*, "names")= chr [1:2] "(Intercept)" "company_revenues" $ residuals : Named num [1:11523] -0.695 -0.754 -0.754 -0.754 -0.754 ... ..- attr(*, "names")= chr [1:11523] "1" "2" "3" "4" ... $ effects : Named num [1:11523] ...

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