From c18b4a4f40df916f7edcc0b6b79191932abfd67e Mon Sep 17 00:00:00 2001 From: hadley Date: Mon, 7 Dec 2015 09:06:19 -0600 Subject: [PATCH] Add needed packages to model-assess --- model-assess.Rmd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/model-assess.Rmd b/model-assess.Rmd index 80c955d..5594e00 100644 --- a/model-assess.Rmd +++ b/model-assess.Rmd @@ -4,6 +4,13 @@ title: Models assessment output: bookdown::html_chapter --- +```{r setup, include=FALSE} +library(purrr) +set.seed(1014) +options(digits = 3) +``` + + ## Multiple models A natural application of `map2()` is handling test-training pairs when doing model evaluation. This is an important modelling technique: you should never evaluate a model on the same data it was fit to because it's going to make you overconfident. Instead, it's better to divide the data up and use one piece to fit the model and the other piece to evaluate it. A popular technique for this is called k-fold cross validation. You randomly hold out x% of the data and fit the model to the rest. You need to repeat this a few times because of random variation.