Question: In this problem, we apply logistic regression to the prediction of NBA game results. To load the NBA game data, please call the following command:

In this problem, we apply logistic regression to the prediction of NBA game results. To load the NBA game data, please call the following command: load(url('https://www.dropbox.com/s/iyqdml9si94zxtf/NBA_1718.rdata?dl=1')) The target variable of the logistic regression is whether the home team wins or loses the given game. We then choose three predictors in the model: name of the home team (TEAM), field goals attempted by the home team (FGA), and the number of defense rebounds caught by the home team (DREB). a. [2 points] In this question, we add the column of the target variable to the training data frame and the test data frame. We make copies of data frames NBA_1718_train and NBA_1718_test by assigning them to data frames df_NBA_1718_train and df_NBA_1718_test, respectively. Then, in both df_NBA_1718_train and df_NBA_1718_test, we create a logical column named isWinner to save the results of a given game. If the winner is the home team, the isWinner should be equal to TRUE; otherwise, it should be equal to FALSE. Note that column W_or_L contains the game results in categorical type. If the home team is the winner, W_or_L is equal to W; otherwise, it is equal to L

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!