可视化每个自变量
能够直观看到模型给出的预测,会更容易理解模型。在只有一个自变量的情况下,seaborn 可以让您无需手动计算就实现这一点。
要可视化数值型自变量与数值型因变量之间的关系,您可以绘制带有线性趋势线的散点图。
要可视化分类型自变量与数值型因变量之间的关系,您可以绘制箱线图。
taiwan_real_estate 已提供可用。
本练习是课程的一部分
Python 中级回归:使用 statsmodels
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Import matplotlib.pyplot and seaborn
____
____
# Create a scatter plot with linear trend line of price_twd_msq vs. n_convenience
____
# Show the plot
____