Okay, next. Now we are going to build another forecasting model using the betting odds as an independent variable. So well, basically, we're going to use the betting on data from the website, and, well, you don't really have to worry about pulling all the betting odds data because all the data is available in our data repository. So the only thing you need to do is to just import the data set from our data repository. So here is the data, and it should be noted that the betting odds are recorded in the form of moneyline out. So well, basically, if you are familiar with the money line odds, then this form is not very difficult to understand. But if you don't understand the way it is written, then I recommend you to review the lecture by Stefan Szymanski in the previous course as he went through about the different types of the betting odds thoroughly. And also he covered about the way to obtain the probabilities by using the money line odds as well. So basically, what we're going to do is to obtain the fitted probabilities by using the moneyline odds here. So here we have fitted probabilities for three potential outcomes. Those are obtained from the money line odds and then, based on the possible three outcomes, we can classify the game result here as well. So, the resulting data frame classify the game results and we picked the highest probability out of three potential outcomes. So the last step we need to do is to evaluate the performance of the model, right? So we are going to merge all those different defeated values, and we are going to compare the performance of our forecasting model against the actual outcome. So as you pass this line of the code now, here we have two columns game ID and the fitted values from the betting odds. And now again, our goal is to compare the fitted values against the actual outcome from the original data set. So here we have game ID, fitted values from the logistic regression. I mean order the logistic regression model with the seller ratio as an independent variable. And also we have the actual outcome of the game here, and then we are going to attach the fitted values from the betting of the model next to this data set. So that's basically what we will do. And we can use the game idea as a matching column so that we can basically compare the traditional rate of the specific game in the regular season directly. So as a result, we have the fitted values from the logistic regression model, using the salary ratio as an independent variable, and we here we have the fitted values from the betting odds model as well. Then we are going to compare how accurate each of which model is by using the actual output in the middle of the data frame. So this line of the code basically compare the fitted values from the betting odds against the actual outcome. That is basically what we did previously by using the acceleration model as well. Then you can get the success rate here. So the betting odds model predicted 58% of the game results correctly, and this model performed slightly better than the celebration model as the celebration model predicted roughly about 57% of the model correctly. However, the difference is rather marginal and given the amount of information that we have. I mean, think about the nature of their business, the betting companies. They spend a lot of money to get accurate betting odds. But what we do is to just to pull the information available publicly. But the prediction rate is fairly similar, right? So even though the salary model is performing poorly, but the difference is rather marginal. Okay, lastly, we're going to compare the performance between the two forecasting models in the context of Brier score. Here again, I'm not going to explain what the Brier score is and how to calculate the Brier score because the Professor Stefan Szymanski covered this part in his lecture thoroughly. So if you don't know what this is and how to calculate the Brier score, then I want you to review his lecture. So, first of all, we need to obtain the binary variable for each outcome. And then we can apply this mathematic formula to obtain the Brier score. So once you obtain the binary dependent variable in each outcome, then we can directly apply the mathematic formula to calculate the Brier score. So well, let's obtain the Brier score for our salary racial model first. Next, we are going to obtain the Brier score for betting odds model as well. So same goes with the data as well. So, first of all, we are going to obtain the dummy variable for each category outcome here. And then we are going to merge those data. I mean, Dummy called it data into the existing data frame. The betting odds data frame here. And then we can just apply the mathematic formula to calculate the Brier score. So the salary model had a slightly lower Brier score than the brier score for the betting odds model. Knowing that the lower the brier score indicates the better the predictions. The celebration model performs slightly better than the betting of the model in the context of a Brier score, which is rather surprising. That's the end of the forecasting model applied to the NHL context. Then we're going to move on to the next league, which is MLB.