Training Sets, Test Sets, R, and ggplot

How to evaluate regression model performance in R
Rating: 4.7 out of 5 (627 ratings)
16,502 students
Training Sets, Test Sets, R, and ggplot
Rating: 4.7 out of 5 (627 ratings)
16,502 students
randomly divide a data set into a training set and a test set
calculate the test MSE (mean squared error)
calculate quickly the MSE for a number of models
visualize the variability of the MSE with ggplot
row-slice data frames
use R's predict function
write for loops in R
write functions of two variables in R
combine functions and for loops
add titles and labels to plots in ggplot

Requirements

  • It is necessary that the students have the background one would get by viewing my two Udemy courses on linear and polynomial regression.
  • Students will need to have R and RStudio installed on their own computers.
Description

In this course, I show you how to evaluate the performance of a regression model using training sets and test sets. We will use R and ggplot as our tools. Along the way, we will learn how to row-slice data frames, use the predict function in R, and add titles and labels to our plots. We will also work on our programming skills by learning how to write for loops and functions of two variables.

Students should have the background in R, ggplot, and regression equivalent to what one would have after viewing my two Udemy courses on linear and polynomial regression. At a relaxed pace, it should take about two weeks to complete the course.

Who this course is for:
  • This course is for those looking to improve their R programming skills.
  • This course is for those with the background equivalent to what one would have after viewing my first two Udemy courses in linear and polynomial regression.
Course content
2 sections • 15 lectures • 1h 30m total length
  • Introduction
    01:28
  • Row-slicing Data Frames
    08:01
  • Plotting the Training and Test Sets
    07:37
  • Plotting the Least-Squares Line
    09:43
  • Calculating the Test MSE
    05:58
  • Generating a Quadratic Model
    06:59
  • Calculating the Test MSE for the Quadratic Model
    02:42
  • For Loops
    03:30
  • lm Revisited
    03:31
  • MSE via a For Loop
    07:39
  • Visualizing the MSE's
    05:41
  • Functions of Two Variables
    01:59
  • For Loop inside a Function
    07:44
  • Variability of the Test MSE
    15:29
  • Course Wrap-up
    02:24

Instructor
Professor at Mercyhurst University
Charles Redmond
  • 4.5 Instructor Rating
  • 5,680 Reviews
  • 69,002 Students
  • 7 Courses

Dr. Charles Redmond is a professor in the Tom Ridge School of Intelligence Studies and Information Science at Mercyhurst University. He has been a member of the Department of Mathematics and Computer Systems at Mercyhurst for 21 years and has recently completed a term as chair of the department. Dr. Redmond received his PhD in mathematics from Lehigh University in 1993 and has published in the Annals of Applied Probability, the Journal of Stochastic Processes and Their Applications, Mathematics Magazine, the College Mathematics Journal, and Mathematics Teacher. In his spare time he enjoys making music and computer generated art, reading, and owning a Clumber Spaniel.