Book Image

Machine Learning with R Quick Start Guide

By : Iván Pastor Sanz
Book Image

Machine Learning with R Quick Start Guide

By: Iván Pastor Sanz

Overview of this book

Machine Learning with R Quick Start Guide takes you on a data-driven journey that starts with the very basics of R and machine learning. It gradually builds upon core concepts so you can handle the varied complexities of data and understand each stage of the machine learning pipeline. From data collection to implementing Natural Language Processing (NLP), this book covers it all. You will implement key machine learning algorithms to understand how they are used to build smart models. You will cover tasks such as clustering, logistic regressions, random forests, support vector machines, and more. Furthermore, you will also look at more advanced aspects such as training neural networks and topic modeling. By the end of the book, you will be able to apply the concepts of machine learning, deal with data-related problems, and solve them using the powerful yet simple language that is R.
Table of Contents (9 chapters)

Support vector machines

The support vector machine (SVM) algorithm is a supervised learning technique. To understand this algorithm, take a look at the following diagram for the optimal hyperplane and maximum margin:

In this classification problem, we only have two classes that exist for many possible solutions to a problem. As shown in the preceding diagram, the SVM classifies these objects by calculating an optimal hyperplane and maximizing the margins between the classes. Both of these things will differentiate the classes to the maximum extent. Samples that are placed closest to the margin are known as support vectors. The problem is then treated as an optimization problem and can be solved by optimization techniques, the most common one being the use of Lagrange multipliers.

Even in a separable linear problem, as shown in the preceding diagram, sometimes, it is not always...