Skip to main content

Machine Learning with caret in R

This course teaches the big ideas in machine learning like how to build and evaluate predictive models.

Start Course for Free
4 Hours24 Videos88 Exercises50,410 Learners6200 XPMachine Learning Fundamentals TrackMachine Learning Scientist Track

Create Your Free Account



By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).

Loved by learners at thousands of companies

Course Description

Machine learning is the study and application of algorithms that learn from and make predictions on data. From search results to self-driving cars, it has manifested itself in all areas of our lives and is one of the most exciting and fast growing fields of research in the world of data science. This course teaches the big ideas in machine learning: how to build and evaluate predictive models, how to tune them for optimal performance, how to preprocess data for better results, and much more. The popular caret R package, which provides a consistent interface to all of R's most powerful machine learning facilities, is used throughout the course.

  1. 1

    Regression models: fitting them and evaluating their performance


    In the first chapter of this course, you'll fit regression models with train() and evaluate their out-of-sample performance using cross-validation and root-mean-square error (RMSE).

    Play Chapter Now
    Welcome to the Toolbox
    50 xp
    In-sample RMSE for linear regression
    50 xp
    In-sample RMSE for linear regression on diamonds
    100 xp
    Out-of-sample error measures
    50 xp
    Out-of-sample RMSE for linear regression
    50 xp
    Randomly order the data frame
    100 xp
    Try an 80/20 split
    100 xp
    Predict on test set
    100 xp
    Calculate test set RMSE by hand
    100 xp
    Comparing out-of-sample RMSE to in-sample RMSE
    50 xp
    50 xp
    Advantage of cross-validation
    50 xp
    10-fold cross-validation
    100 xp
    5-fold cross-validation
    100 xp
    5 x 5-fold cross-validation
    100 xp
    Making predictions on new data
    100 xp

In the following tracks

Machine Learning FundamentalsMachine Learning Scientist


n10iNick CarcheditommyjeeTom Jeon
Zachary Deane-Mayer Headshot

Zachary Deane-Mayer

VP, Data Science at DataRobot

Zach is a Data Scientist at DataRobot and co-author of the caret R package. He's fascinated by predicting the future and spends his free time competing in predictive modeling competitions. He's currently one of top 500 data scientists on Kaggle and took 9th place in the Heritage Health Prize as part of the Analytics Inside team.
See More
Max Kuhn Headshot

Max Kuhn

Software Engineer at RStudio and creator of caret

Dr. Max Kuhn is a Software Engineer at RStudio. He is the author or maintainer of several R packages for predictive modeling including caret, AppliedPredictiveModeling, Cubist, C50 and SparseLDA. He routinely teaches classes in predictive modeling at Predictive Analytics World and UseR! and his publications include work on neuroscience biomarkers, drug discovery, molecular diagnostics and response surface methodology.
See More

What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph
Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden
Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers
Decision Science Analytics, USAA