LoslegenKostenlos loslegen

Apply a missing value ratio filter

Now that you have calculated the missing value ratios, you can create a filter using a missing value threshold. In this exercise, we will select an arbitrary, but reasonable, missing value ratio threshold and apply it to all the columns. In the real world, you will think critically and customize the threshold to each feature.

The missing_vals_df which contains the ratios you calculated in the last exercise and the house_sales_df data frame are both available for your use. The tidyverse package has also been loaded for you.

Diese Übung ist Teil des Kurses

Dimensionality Reduction in R

Kurs anzeigen

Anleitung zur Übung

  • Use missing_vals_df and a threshold of 0.5 to create a missing values ratio filter and store it in missing_vals_filter.
  • Apply missing_vals_df to house_sales_df to reduce its dimensionality and store the new data frame in filtered_house_sales_df.

Interaktive Übung

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

# Create the missing values filter
___ <- ___ %>% 
  ___(___ <= ___) %>% 
  ___(___)

# Apply the missing values filter
filtered_house_sales_df <- ___ %>% 
  ___(___)

# Display the first five rows of data
___ %>% ___(___)
Code bearbeiten und ausführen