Locked lesson.
About this lesson
In this video, we'll learn how to make predictions and analyze results based on the data analysis we've performed so far.
Exercise files
Download this lesson’s related exercise files.
Make Predictions and Analyze Results.docx57.1 KB Make Predictions and Analyze Results - Solution.docx
55.8 KB
Quick reference
Make Predictions and Analyze Results
Next it's time to make predictions and analyze the result with a scatter plot and a dist plot.
When to use
Do this at the end of every Linear Regression.
Instructions
Create a variable named 'predictions' and set it equal to our model predictions.
predictions = lin.predict(X_test)
Run a scatter plot of the y_test data vs. our predictions.
plt.scatter(y_test, predictions)
Run a Seaborn distplot to determine whether the data is normally distributed.
sns.distplot((y_test - predictions))
Hints & tips
- predictions = lin.predict(X_test)
- plt.scatter(y_test, predictions)
- sns.distplot((y_test - predictions))
Lesson notes are only available for subscribers.