Right now let's walk through part two, where we're going to actually create our linear decision boundary. Now, our goal is to look at the decision boundary of a LinearSVC classifier using our data set. Now we're going to fit a linear support vector machine classifier using our x with just two dimensions and our y. We're then going to pick 300 samples from our x and get the corresponding y values for each one of those 300 samples, and store them in variables x_color and y_color, and this is because our original data sets could be too large when we actually want to plot this out within our two-dimensional frame. We're then going to modify y_color. So that's red instead of one, and yellow instead of zero. So it's touching them back to their actual strings, and that will allow us to also color code our graphs. We're then going to have a scatter plot of our x_colors columns using the keyword arguments color equals y_color using those colors that we just discussed. Then we're going to use this code that we have below in order to come up with this contour plot that will show, given each one of our two variables, which we'll have on the x and y-axis, what is going to be our prediction. I'm going to break that out step-by-step. First, I'm going to run this code here, and then we're going to break this out step-by-step. So we see at the end that we produced this plot where we have the classifier being that red line, and below that line we classified as red wine, and above that line we classified as white wine. So how did we get there? The first thing that we want to do is first initiate our model. So we run LSVC, and then we fit it on every single value in our training set on x and y. Again, we're not having a holdout set here, so we're fitting on every single data point. So we have the best fit possible for our model. We're then going to get our sample of just 300 of those rows. As discussed, we only want a small sample, because otherwise this plot below would have been overcrowded. We're then going to use that x_color, which is just a sample of 300 points, and set our y_color to just the same exact values with that same index that we just identified. So now our x_color and y_color will match up. Then as mentioned, we're going to take that y_color and map Lambda r. That's just saying r is going to be our input. We're going to call it red if that value is equal to one, and then we'll call it yellow if it's anything else, which will just be zero. So now we've mapped our y_color from ones and zeros to reds and yellows. We're then going to initiate our bounding box using plt.axes. Then we're just going to plot our scatter plot of the two values using x.scatter. Then we call x_color, which is our features, and we're saying all of our rows and just the first column, that's going to be our x-axis, and all of our rows in the second column, that's going to be our y-axis. Then for that, we're going to also identify the colors, which is going to be our labels here as red or yellow using that y_color that we just identified. So at this point, if we just plotted that out, let's copy this above. We just have the scatter plot without our line that would be separating those two out. Now we want to see how did we come up with a linear separator on this plot. That's where all of this code that we have above starts to come into play. So the first thing that we do when we call np.arange 0-1.005, counting by 0.005, it's just we have that many values. Let's just show this above. You see that we have values counting from 0-1, counting by 0.005, and we don't include that last value. So we have that for both our x-axis and our y-axis. We're then going to pass that into something called the np.meshgrid. Now, I'm going to show you what that xx and yy that it outputs look like. We have here this xx, which is just going to be for every single y variable, we will repeat that x multiple times. So you see that each one of these rows are exactly the same, and then we'll see that each one of these y's are exactly the same, again on different axes. That will allow us to look across this grid. So if we look back at our scatter plot above, we can imagine that being a grid of ranging from 0-1, counting by 0.005, where you can look at each one of these different x and y values and seeing what the actual outcome will be for each one of those x and y values. So now that we have this grouping of all these different x and y values ranging from 0-1 on the x-axis and 0-1 on the y-axis, we then are going to use this ravel function to just have that all in one long array. So I can see yy.ravel, and you see for yy.ravel and xx.ravel, you'll just have all the values multiple times. We can look at the shape, it's actually really big because it's going to be each one those values that we had from 0-1 for every single value of y, so that we can check for every single value of x and every single value of y. Then what should make this all clear is when we put this all into a data frame, and get our grid. This may take just a second. Now, this will be every single value at the 0 of x, and every single value of y, and each of those x's and y's are meant to represent a fictional amount of either acidity or total sulfur dioxide, and for every single one of those values, and remember, those values were scaled so between 0 and. So we're looking through all the different possible values between 0 and 1, and then we're actually going to predict on this data frame for every single one of these potential values for 0 or 1, what the LinearSVC that we learned on our x and y would have predicted. So that's where we see LSVC.predicts on our x grid, which is just that data frame. Then we are reshaping that, so that it's the same shape as our xx.shape. So originally, it'll just be a single array. We can look at our y grid, we'll have to call it like this. Pull this out. We see that this is just going to be a single array. Then when we call reshape to xx.shape, it's now going to be that same shape as xx as well as yy, and when we run our contour graph, we can call xx, yy. Then for each one of those x's and y's, we can pass in what the prediction is, and that's what that allows us to do. So now we have our x, our y, as well as our prediction. Then when we run this on top, we end up with our decision boundary, where we get each one of our predictions, and they're just going to predict either ones or zeros because that's going to be what our LinearSVC is going to predict, and it's going to map the ones giving our color map as red and our zeros as yellow. So that's how we end up with our contour plot on top. So now we know how to create this contour plot on top of a scatter plot given our decision boundary, and from here, we'll learn how to also look at using the graph we just explained, how to look at different Gaussian kernels as well of [inaudible] hyperparameters to see the effects of regularization versus not regularizing our different models that we're going to use. I'll see you in the next video.