視覺化每個解釋變數
能直接看到模型的預測,有助於理解模型。在只有 1 個解釋變數的情況下,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
____