Book Image

Applied Supervised Learning with R

By : Karthik Ramasubramanian, Jojo Moolayil
Book Image

Applied Supervised Learning with R

By: Karthik Ramasubramanian, Jojo Moolayil

Overview of this book

R provides excellent visualization features that are essential for exploring data before using it in automated learning. Applied Supervised Learning with R helps you cover the complete process of employing R to develop applications using supervised machine learning algorithms for your business needs. The book starts by helping you develop your analytical thinking to create a problem statement using business inputs and domain research. You will then learn different evaluation metrics that compare various algorithms, and later progress to using these metrics to select the best algorithm for your problem. After finalizing the algorithm you want to use, you will study the hyperparameter optimization technique to fine-tune your set of optimal parameters. The book demonstrates how you can add different regularization terms to avoid overfitting your model. By the end of this book, you will have gained the advanced skills you need for modeling a supervised machine learning algorithm that precisely fulfills your business needs.
Table of Contents (12 chapters)
Applied Supervised Learning with R
Preface

Quantile Regression


When the data presents outliers, high skewness, and conditions leading to heteroscedasticity, we employ quantile regression for modelling. Also, one key question quantile regression answers, which linear regression cannot, is "Does DEWP, TEMP, and Iws influence PM2.5 levels differently for high PM2.5 than for average PM2.5?"

Quantile regression is quite similar to linear regression; however, the quantile regression parameter estimates the change in a certain quantile of the response variable produced by a unit change in the input predictor variable. In order to fully understand this statement, let's fit our Beijing data using quantile regression (without using the interaction terms).

We need to install the quantreg package to fit the quantile regression into the data. The package offers the method, rq() to fit the data using the argument tau, which is the model parameter specifying the value of quantile to be used for fitting the model into the data. Observe that the other...