可视化两个数值型变量
在运行任何统计模型之前,通常先对数据集进行可视化更稳妥。这里,您将使用台湾房地产数据集,考察每平方米房价与附近便利店数量之间的关系。
该数据集的一个挑战是便利店数量为整数数据,点会重叠。为了解决这个问题,您将把散点设为半透明。
taiwan_real_estate 已作为 pandas 的 DataFrame 提供。
本练习是课程的一部分
使用 Python 中的 statsmodels 进行回归入门
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Import seaborn with alias sns
____
# Import matplotlib.pyplot with alias plt
____
# Draw the scatter plot
sns.____(____)
# Show the plot
plt.____()