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.
Diese Übung ist Teil des Kurses
Intermediate Regression with statsmodels in Python
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Extract the model coefficients, coeffs
coeffs = ____
# Print coeffs
print(coeffs)
# Assign each of the coeffs
____, ____, ____, ____ = ____