Directions: Follow along with the slides and answer the questions in red font in your journal.
heights, we want see how well we predict the
heightsof people that we haven't yet measured.
arm_spandata, fill in the blanks to create a
set.seed(123) train_rows <- sample(1:____, size = 85) train <- slice(arm_span, ____) test <- slice(____, - ____)
set.seed, we're able to reproduce the random splitting so that each person's model outputs the same results.
Whenever you split data into training and testing, always use
predict()function we introduced in the last lab to make predictions.
test <- mutate(test, ____ = predict(best_train, newdata = ____))
heightfor each value of
heightbased on their
armspanreally well for people already shown in our plot but would predict people not in our plot very poorly.