LoslegenKostenlos loslegen

Create a missing values filter

The zero-variance filter only removes some of the low-information features. Features may also contain little to no information because they have a high number of missing values. In this exercise, you'll create a missing values filter. You'll take an extreme approach and remove any feature with at least one missing value, which means you could remove features with significant information.

house_sales_df is available on the console and tidyverse package has been loaded for you.

Diese Übung ist Teil des Kurses

Dimensionality Reduction in R

Kurs anzeigen

Anleitung zur Übung

  • Create a missing values filter using summarize(), across(), sum(), and is.na() to remove features with zero or more missing values and store it in na_filter.

Interaktive Übung

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

# Create a missing values filter
___ <- ___ %>% 
  ___(across(everything(), ~ ___)) %>% 
  pivot_longer(everything(), names_to = "feature", values_to = "NA_count") %>% 
  ___(___ > ___) %>% 
  pull(feature)
  
na_filter
Code bearbeiten und ausführen