March 2019
Beginner to intermediate
448 pages
13h 14m
English
In the following example, we will load data for the 2019 season for the Los Angeles Lakers. We will have one dummy for each player, flagging if that player was part of the starting team that night, plus an extra dummy that flags if the team is playing at home or away. The objective is to predict if the team won that night using just those dummies as explanatory variables. Ideally, we would like our model to capture those complicated interactions that might occur (that is, Player X might perform much better if Player Y was present):
library(caret)set.seed(10)baseketball_data_2019 = read.csv("./lakers_.csv")baseketball_data_2019 = baseketball_data_2019[,-c(1,2)] ...
Read now
Unlock full access