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

Supervised learning


This chapter will show you some examples of popular supervised learning algorithms. These techniques are very useful for facing business problems because they make predictions about future attributes and outcomes. In addition, it is possible to measure the accuracy of each technique and/or parameter in order to choose the most suitable one and set it up in the best way.

As anticipated, there are two categories of techniques: classification and regression. However, most of the techniques can be used in both the contexts. Each of the following subsections introduces a different algorithm.

The k-nearest neighbors algorithm

KNN is a supervised learning algorithm that performs classification or regression. Given a new object, the algorithm predicts its attribute starting from its k neighbors that are its most similar objects. KNN is a lazy learning algorithm in the sense that it directly queries the training data to make a prediction.

In the case of a categoric attribute, the...