Now we got some ideas we want to test, we're going to look at how we take the data, apply models to it, and evaluate the outputs of those models. In this last section, we're going to look at two things. One is running this model, this regression model on the data. And then the last one is the optimization. So, basically, how do we make the optimal intervention in week one about how much we're going to spend on promoting this movie in week two? All right. So, let's loop through these and talk about them a little bit. So, the idea is, we've got this idea that there are these certain independent variables that are going to help us predict the box office performance in week two. And so, essentially what this code is saying is that we're going to try and predict box office week two. That's our dependent variable that we're trying to predict from this series of independent variables here, which are ad spending and week two, the box office take that we saw in week one. These are all things that we're going to know. The amount of screens that we have this thing playing on our channel in week two. The rating, is it an R-rated movie or not? And then this interaction between the effect of ad spending, in the case where we've got a critic score above 60% on Rotten Tomatoes. And all this stuff down here is is more detail than we want to sort out here. But one statistic that I'll call attention to is this idea of R-squared. And basically, what this is telling us is how much of the variation between all these different items in our data set do the independent variables explain. How much of the variation of our dependent variable, which we see here, does it explain? This is saying, 1 would be it explains everything 86% says that it explains 86% percent of the variation. Then we're going to look at down here, we would expect the part that we can't explain to be normally distributed like a bell. And this is just looking at is that the case or not? Because if it's not the case, there might be something weird going on that we're missing. So, what we're bringing into this optimization now is a is a ability to say, all right, well, for any given movie, based on these independent variables that we might know about it, like the things that we just went through. We can predict reasonably well what its box office take is going to be in week two. And so, what we're essentially doing here is asking, okay, well, based on that, if we vary the amount of ad spending that we might do in week two, which is our intervention. What is the exact right amount of ad spending, based on all this, that we would want to make to optimize our profit? Which were just assuming here is 40% of the aggregate revenue. So, if we're assuming that 40% comes back to ATO pictures. And essentially this is just looking at the attributes of Casino Jack, and then looking at how much money they should spend on promoting this movie, which is $3,731. And this is a visual representation on the Y-axis here, we have expected profit. And here on the X-axis we have ad spending, and this is that $3,700 mark. We can see that our profit goes up, up, up, plateaus here and then starts to decline. So, this is our optimal point here. And [LAUGH] then this down here is just looking at well, but what do they actually do and how does that compare? They basically spent a lot more money than that $246,000 on promoting the film. So, it wasn't super profitable and they're sure there were other circumstances and reasons why they might have done that. But this is just unpacking that. And so, what this is, this is interesting because this allows us to perhaps at least make a more informed decision about how much money we want to invest. I mean, this is a pretty good thing for our analyst. And if we were doing this at scale, for example, what we might want to do is summarize all this into a dashboard tool that just outputted the single variable if our audience didn't want to look at that. So, it's another thing to think about is, what is the frequency and volume of decisions and interventions you might want to make. That's something where you might want to do your early analysis in something like this and then, and then you'll see tools like Shiny is a popular dashboard tool. There are many others that that we would create to help our users make decisions at scale. But, so this is looking under the hood at how we would create a model to design this intervention around Casino Jack. It was not important for you to understand all these various details, but the idea was to just make this process slightly less mysterious. And this doesn't represent necessarily every single thing that a data scientist might do. But it's, I would say, a reasonably good overview of the kind of things that they might do. So, if you took that away then mission accomplished with these videos.