開始使用免費開始

再次進行預測

你已經用過不同組合的解釋變數,多次走過預測流程。現在再試一次,套用到含有三個解釋變數的模型上。這裡你會使用具有三向交互作用的模型;不過,無論是上一題中的哪一個模型,使用的程式碼都相同。

taiwan_real_estatemdl_price_vs_all_3_way_inter 已可使用。itertools.product 已載入。

本練習屬於課程

使用 Python 的 statsmodels 進行迴歸分析:中級

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Create n_convenience as an array of numbers from 0 to 10
n_convenience = ____

# Create sqrt_dist_to_mrt_m as an array of numbers from 0 to 80 in steps of 10
sqrt_dist_to_mrt_m = ____

# Create house_age_years with unique values
house_age_years = ____

# Create p as all combinations of n_convenience, sqrt_dist_to_mrt_m, and house_age_years, in that order
p = ____

# Transform p to a DataFrame and name the columns
explanatory_data = ____

# See the result
print(explanatory_data)
編輯並執行程式碼