Book Image

R Machine Learning Essentials

By : Michele Usuelli
Book Image

R Machine Learning Essentials

By: Michele Usuelli

Overview of this book

Table of Contents (15 chapters)
R Machine Learning Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Predicting the output


The past marketing campaign targeted part of the customer base. Among other 1,000 clients, how do we identify the 100 that are keener to subscribe? We can build a model that learns from the data and estimates which clients are more similar to the ones that subscribed in the previous campaign. For each client, the model estimates a score that is higher if the client is more likely to subscribe. There are different machine learning models determining the scores and we use two well-performing techniques, as follows:

  • Logistic regression: This is a variation of the linear regression to predict a binary output

  • Random forest: This is an ensemble based on a decision tree that works well in presence of many features

In the end, we need to choose one out of the two techniques. There are cross-validation methods that allow us to estimate model accuracy (see Chapter 6, Step 3 – Validating the Results). Starting from that, we can measure the accuracy of both the options and pick...