算術型特徵
為了練習建立新特徵,你會使用 Kaggle 競賽「House Prices: Advanced Regression Techniques」中的一個子樣本。這個競賽的目標是根據房屋的各項屬性來預測房價。這是一個迴歸問題,評估指標為 Root Mean Squared Error。
你的目標是建立新特徵,並判斷它們是否能提升你的驗證分數。要從 5 折交叉驗證取得驗證分數,系統已提供 get_kfold_rmse() 函式。請以工作空間中可用的 train DataFrame 作為引數來呼叫它。
本練習屬於課程
用 Python 拿下 Kaggle 競賽
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Look at the initial RMSE
print('RMSE before feature engineering:', get_kfold_rmse(train))
# Find the total area of the house
train['TotalArea'] = ____[____] + ____[____] + ____[____]
# Look at the updated RMSE
print('RMSE with total area:', get_kfold_rmse(train))