使用組合篩選器進行特徵選擇
你已經建立了零變異與遺漏值篩選器,現在就把它們用在 house_sales_df 上,降低其維度吧。你會先把這些篩選器結合,接著用組合後的篩選器,從 house_sales_df 中移除低資訊的特徵。
zero_var_filter 與 na_filter 物件已可供你使用,且已為你載入 tidyverse 套件。
本練習屬於課程
R 的降維
練習說明
- 將
zero_var_filter和na_filter結合為low_info_filter。 - 套用
low_info_filter,以降低house_sales_df的維度。 - 顯示降維後的
house_sales_df資料集的 5 列資料。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Combine the two filters
___ <- ___(___, ___)
# Apply the filter
house_sales_filtered_df <- ___ %>%
___(-all_of(___))
# Display five rows of the reduced data set
house_sales_filtered_df %>%
___(___)