October 2017
Beginner to intermediate
572 pages
26h 1m
English
If you would like to perform cross-validation on a linear regression model, you can use the tune function within the e1071 package:
> tune(lm, y3~x, data = Quartet) Output Error estimation of 'lm' using 10-fold cross validation: 2.33754
Other than the e1071 package, you can use the train function from the caret package to perform cross-validation. In addition to this, you can also use cv.lm from the DAAG package to achieve the same goal.
Read now
Unlock full access