LoslegenKostenlos loslegen

Create a low-variance filter

In this exercise, you are given house_sales_df which contains seventeen continuous features. Some of those features do not have any variance. Some of them have very little variance. You will explore the variances and establish a filter using an appropriate variance threshold. This approach is useful for reducing dimensions with little to no information, but as you'll see, it has a few drawbacks.

The tidyverse and tidymodels packages have been loaded for you.

Diese Übung ist Teil des Kurses

Dimensionality Reduction in R

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Calculate feature variances
houses_sales_variances <- ___ %>% 
  summarize(across(everything(), ~ ___(___(., ___ = ___), na.rm = ___))) %>% 
  pivot_longer(everything(), names_to = "feature", values_to = "variance") %>% 
  ___(desc(___))

houses_sales_variances
Code bearbeiten und ausführen