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.
This exercise is part of the course
Dimensionality Reduction in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Calculate feature variances
houses_sales_variances <- ___ %>%
summarize(across(everything(), ~ ___(___(., ___ = ___), na.rm = ___))) %>%
pivot_longer(everything(), names_to = "feature", values_to = "variance") %>%
___(desc(___))
houses_sales_variances