Visualizing parallel slopes model predictions
To make sure you've got the right predictions from the previous exercise, you can add them to a seaborn
plot. To visualize multiple regression predictions, you use the same procedure as with linear regression: draw a scatter plot with a trend line and add a second layer of prediction points on the same plot. As you've seen in a previous exercise, seaborn
can't plot the parallel slopes model directly. Therefore, you'll first re-extract the model coefficients before you plot the prediction points.
taiwan_real_estate
and prediction_data
are available, and mdl_price_vs_both
is available as a fitted model.
This exercise is part of the course
Intermediate Regression with statsmodels in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Extract the model coefficients, coeffs
coeffs = ____
# Print coeffs
print(coeffs)
# Assign each of the coeffs
____, ____, ____, ____ = ____