[MUSIC]
So what we're gonna do next
is #Let's show what our
predictions look like.
Now I talked about using GraphLab Canvas as a way to visualize data, but
you can also use other tools out there to visualize; other python tools.
So just as a simple demonstration of that, I'm going to import one search tool.
It's a pretty commonly used one.
It's called mot plot lib.
And so, and from there I'm gonna
input something called pipe plot which allows you to do some plotting in Python.
And I'm gonna refer to it as PLT.
So when you're doing the importing Python, if you type import myplotlib.pyplot,
is a particular piece of the package, and I write as plt.
Now I don't have to write this whole thing matlab_lib.pyplot blah blah blah,
I just write plt.
That's why we use the as command.
So I'm gonna import it, and one little trick I'm gonna do, just like you did with
Canvas to make sure it prints inside the notebook I'm gonna do it here too.
So you put this percent, and
you say, matplotlib inline.
So that just plots it on the notebook itself.
So let's hit Enter.
We've imported it, and now I'm going to actually build
a map plot lib plot for the results, for the initial results.
So we're gonna plot plt.plot.
And there's a function here.
And I'm gonna plot my test data in two ways.
So it's interesting, can plot two multiple plots on top of each other with MyPlot 11.
We're just gonna do that together.
So I'm gonna take my test data and in my test data I'm
gonna plot on the x-axis the square feet of living space.
And in the y-axis for my test data, I'm going to plot the price.
So, this is kind of similar to the plot we did above, the scatter plot.
And I'm gonna refer to each one of these points as test points.
I'm gonna draw them as a dot.
So, that's what this little dot here does.
However, I'm also going to plot one more thing.
So I'm going to plot two things on the same plot.
Actually, so I'm missing a comma up here.
So in addition to plotting the test data, let's plot our predictions.
So again, on the x-axis is going to be the square feet of living space,
but on the y-axis, I'm going to plot something else.
I'm going to plot what my model predicted for each one of those houses.
So remember we built this square foot model and
it has many functions associated with it.
If you go down, one of those functions it has is called the predict function.
And the predict function, you can give it a bunch of data's input and
it's gonna output and estimates our column of data with the predictions for
each one of these input elements.
So, I'm giving you the test data and I'm going to draw it as a dash.
Now, before I execute this line,
just take a moment to imagine what this plot is going to look like.
So, the top line says plot living space through the price test data with dots.
It's going to look very similar to the scatterplot that we drew before.
And the second line says plot
the input houses living with the prediction with a dash.
And now remember this was a simple linear regression model with a single variable so
all we have is a single variable and
as we covered in the lectures, we just plotted a single line.
And we'll see that execute and here we are.
So the blue dots here are the test data for the houses,
while the green line corresponds to the predicted house values.
[MUSIC]