Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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). Call the predict function to predict the results of games in the test data frame df_NBA_1718_test, and save the predicted probability of the home team to win in numeric vector pred_prob_test. Then, convert the predicted probabilities into predicted game results in logical values, and save the logical results in vector pred_test, where TRUE means that the home team is predicted to be the winner and FALSE means that they are predicted to lose. d. [1 point + 1 bonus point] Using the predictions from question c, compute the predictions' accuracy and save it in numeric scaler accuracy (please keep the decimal format). Then, compute the predictions' sensitivity and save it in numeric scaler sensitivity. (Hint: Select the comparison results where isWinner is TRUE.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started