Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Regression Analysis with R

You're reading from  Regression Analysis with R

Product type Book
Published in Jan 2018
Publisher Packt
ISBN-13 9781788627306
Pages 422 pages
Edition 1st Edition
Languages
Author (1):
Giuseppe Ciaburro Giuseppe Ciaburro
Profile icon Giuseppe Ciaburro

Table of Contents (15) Chapters

Title Page
Packt Upsell
Contributors
Preface
1. Getting Started with Regression 2. Basic Concepts – Simple Linear Regression 3. More Than Just One Predictor – MLR 4. When the Response Falls into Two Categories – Logistic Regression 5. Data Preparation Using R Tools 6. Avoiding Overfitting Problems - Achieving Generalization 7. Going Further with Regression Models 8. Beyond Linearity – When Curving Is Much Better 9. Regression Analysis in Practice 1. Other Books You May Enjoy Index

Preface

Regression analysis is a statistical process that enables predictions of relationships between variables. The predictions are based on the effect of one variable on another. Regression techniques for modeling and analyzing are employed on large sets of data in order to reveal hidden relationships among the variables.

This book will give you a rundown of regression analysis and will explain the process from scratch. The first few chapters explain what the different types of learning are—supervised and unsupervised—and how they differ from each other. We then move on to cover supervised learning in detail, covering the various aspects of regression analysis. The chapters are arranged in such a way that they give a feel of all the steps covered in a data science process: loading the training dataset, handling missing values, EDA on the dataset, transformations and feature engineering, model building, assessing the model fitting and performance, and finally making predictions on unseen datasets. Each chapter starts with explaining the theoretical concepts, and once the reader gets comfortable with the theory, we move to the practical examples to support their understanding. The practical examples are illustrated using R code, including different packages in R such as R stats and caret. Each chapter is a mix of theory and practical examples.

By the end of this book, you will know all the concepts and pain points related to regression analysis, and you will be able to implement what you have learnt in your projects.

Who this book is for

This book is intended for budding data scientists and data analysts who want to implement regression analysis techniques using R. If you are interested in statistics, data science, and machine learning and want to get an easy introduction to these topics, then this book is what you need! A basic understanding of statistics and math will help you to get the most out of the book. Some programming experience with R will also be helpful.

What this book covers

Chapter 1, Getting Started with Regression, teaches by example why regression is useful for data science and how to quickly set up R for data science. We provide an overview of the packages used throughout the book.

 

Chapter 2, Basic Concepts – Simple Linear Regression, introduces regression with the simplest algorithm: simple linear regression. The chapter first describes a regression problem and where to fit a regressor, and then gives some intuitions underneath the math formulation.

Chapter 3, More Than Just One Predictor – MLR, shows how simple linear regression will be extended to extract predictive information from more than a feature. The stochastic gradient descent technique, explained in the previous chapter, will be scaled to cope with a vector of features.

Chapter 4, When the Response Falls into Two Categories – Logistic Regression, shows you how to approach classification and how to build a classifier that predicts class probability.

Chapter 5, Data Preparation Using R Tools, teaches you to properly parse a dataset, clean it, and create an output matrix optimally built for regression.

Chapter 6, Avoiding Overfitting Problems – Achieving Generalization, helps you avoid overfitting and create models with low bias and variance. Many techniques will be presented here to do so: stepwise selection and regularization (ridge, lasso, and elasticnet).

Chapter 7, Going Further with Regression Models, addresses the scaling problem, introducing a new set of techniques. We will learn how to scale linear models to a big dataset and how to deal with incremental data.

Chapter 8, Beyond Linearity – When Curving Is Much Better, applies advanced techniques to solve regression problems that cannot be solved with linear models.

Chapter 9, Regression Analysis in Practice, presents a series of applications where regression models can be successfully applied, allowing the reader to grasp possible applications for her/his own problems.

To get the most out of this book

This book is focused on regression analysis in an R environment. We have used R version 3.4.2 to build various applications and the open source and enterprise-ready professional software for R, RStudio version 1.0.153. We've focused on how to utilize various R libraries in the best possible way to build real-world applications. These libraries (called packages) are available for free at the following URL: https://cran.r-project.org/web/packages/index.html. In that spirit, we have tried to keep all of the code as friendly and readable as possible. We feel that this will enable our readers to easily understand the code and readily use it in different scenarios.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Regression-Analysis-with-R. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/RegressionAnalysiswithR_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: " In the following figure, the R version 3.4.1 interface is shown."

Any command-line input or output is written as follows:

$ mkdir css
$ cd css

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The purposes of regression as a statistical tool are of two types synthesize and generalize, as shown in the following figure."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email feedback@packtpub.com and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at questions@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packtpub.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.

 

 

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 $15.99/month. Cancel anytime}