Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Applied Supervised Learning with R

You're reading from   Applied Supervised Learning with R Use machine learning libraries of R to build models that solve business problems and predict future trends

Arrow left icon
Product type Paperback
Published in May 2019
Publisher
ISBN-13 9781838556334
Length 502 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Jojo Moolayil Jojo Moolayil
Author Profile Icon Jojo Moolayil
Jojo Moolayil
Karthik Ramasubramanian Karthik Ramasubramanian
Author Profile Icon Karthik Ramasubramanian
Karthik Ramasubramanian
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Applied Supervised Learning with R
Preface
1. R for Advanced Analytics FREE CHAPTER 2. Exploratory Analysis of Data 3. Introduction to Supervised Learning 4. Regression 5. Classification 6. Feature Selection and Dimensionality Reduction 7. Model Improvements 8. Model Deployment 9. Capstone Project - Based on Research Papers Appendix

Model Diagnostics


Often statistical models such as linear regression and logistic regressions come with many assumptions that need to be validated before accepting the final solution. A model violating the assumptions will result in erroneous prediction and results will be prone to misinterpretation.

The following code shows a method for obtaining the diagnostic plots from the output of the lm() method. The plot has four different plots looking at the residuals. Let's understand how to interpret each plot. All these plots are about how well the fit matches the regression assumptions. If there is a violation, it will be clearly shown in the plots of the following code:

par(mfrow = c(2,2))
plot(multiple_PM25_linear_model)

The output is as follows:

Figure 4.1: Diagnostics plot for the linear model fit on the Beijing PM2.5 dataset

In the next four sections, we will explore each of the plots with randomly generated data from a linear equation and a quadratic equation , and later come back to explain...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime