ComeçarComece de graça

Dimensionality and feature information

Imagine you work for a bank and have collected information about different loans made to different people. Your boss wants you to begin exploring the possibility of using this data to classify customers into different credit score categories. A sample of the available data is loaded into credit_df. You are curious about how many features the data has. You also want to identify features that will not be useful for classifying customers into different credit categories.

The tidyverse package has been loaded for you.

Este exercício faz parte do curso

Dimensionality Reduction in R

Ver curso

Instruções do exercício

  • Find the number of features in credit_df.
  • Compute the variance of each feature in credit_df.
  • Identify the feature with zero variance and assign it to column_to_remove.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Find the number of features
___ %>% ___()

# Compute each column variance
credit_df %>% 
  ___(___(___(), ~ ___(., na.rm = TRUE))) %>% 
  pivot_longer(everything(), names_to = "feature", values_to = "variance")

# Assign the zero-variance column
column_to_remove <- "___"
Editar e executar o código