Skip to Content
Introduction to Machine Learning with R
book

Introduction to Machine Learning with R

by Scott V. Burger
March 2018
Beginner to intermediate
223 pages
5h 38m
English
O'Reilly Media, Inc.
Content preview from Introduction to Machine Learning with R

Chapter 8. Machine Learning with the caret Package

So far, we’ve been doing machine learning in a very ad hoc manner. We have some data, we want to fit a model to it, and then we tune the model to give us the best result based on whatever sampling processes we might have done and depending on how the data itself is organized. A lot of this relies on the ability to recognize when to use certain algorithms. Just by visualizing a set of data, we can usually determine whether we can slap a linear regression on it, if it makes sense. Likewise, we’ve seen examples for which data is better suited to be clustered via a kmeans algorithm or something similar.

One issue that we’ve seen is that a lot of these algorithms can be very different from one another. The options for the lm() function are quite different from that of the nnet() function. Surely there exists something that provides a common interface for all these different yet commonly used algorithms. We’re in luck with R in that the caret package offers a powerhouse of tools for us to use to help streamline our model building.

The name “caret” is an acronym that stands for “Classification and Regression Training,” but the package itself is capable of much more. In the R ecosystem, there are hundreds of machine learning packages. Becoming familiar with the quirks and special functionality for each one can be a daunting task. Lucky for us, caret provides a common interface for all of these packages. Caret also provides great functionality ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Machine Learning with R - Fourth Edition

Machine Learning with R - Fourth Edition

Brett Lantz
Introduction to Machine Learning with Python

Introduction to Machine Learning with Python

Andreas C. Müller, Sarah Guido

Publisher Resources

ISBN: 9781491976432Errata Page