Skip to Content
R Programming By Example
book

R Programming By Example

by Omar Trejo Navarro
December 2017
Beginner to intermediate
470 pages
12h 29m
English
Packt Publishing
Content preview from R Programming By Example

Training and testing datasets

For us to be able to measure the predictive accuracy of our models, we need to use some observations to validate our results. This means that our data will be split into three different groups:

  • Training data
  • Testing data
  • Predicting data

The predicting data is the data that we don't have complete cases for, specifically these are wards for which the Vote and Proportion variables have NA values. Our final objective is to provide predictions for these ward's Proportion and Vote variables using what we can learn from other wards for which we do have data for these variables, and it's something we'll do toward the end of the chapter.

The data that has complete cases will be split into two parts, training, and testing ...

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.
Start your free trial

You might also like

Efficient R Programming

Efficient R Programming

Colin Gillespie, Robin Lovelace
R Programming

R Programming

Jared P. Lander

Publisher Resources

ISBN: 9781788292542Supplemental Content