1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Regression with statsmodels in Python

Exercise

Visualizing each explanatory variable

Being able to see the predictions made by a model makes it easier to understand. In the case where there is only one explanatory variable, seaborn lets you do this without any manual calculation.

To visualize the relationship between a numeric explanatory variable and the numeric response, you can draw a scatter plot with a linear trend line.

To visualize the relationship between a categorical explanatory variable and the numeric response, you can draw a box plot.

taiwan_real_estate is available.

Instructions 1/2

undefined XP
  • 1
    • Import matplotlib.pyplot as plt and seaborn as sns.
    • Using the taiwan_real_estate dataset, plot the house price versus the number of nearby convenience stores as a scatter plot with a linear trend line, without a confidence interval ribbon.
    • Display the plot.
  • 2
    • Using the taiwan_real_estate dataset, plot the house price versus the house age as a box plot.