From 53ec52a9546fe05675f3c6f36404f2fd01793091 Mon Sep 17 00:00:00 2001 From: junos Date: Wed, 13 Apr 2022 16:01:31 +0200 Subject: [PATCH] Disable (SOME) feature cleaning for ESM data. --- src/features/all_cleaning_individual/rapids/main.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/all_cleaning_individual/rapids/main.R b/src/features/all_cleaning_individual/rapids/main.R index 6221c428..1d1636c2 100644 --- a/src/features/all_cleaning_individual/rapids/main.R +++ b/src/features/all_cleaning_individual/rapids/main.R @@ -44,11 +44,11 @@ rapids_cleaning <- function(sensor_data_files, provider){ # Drop columns with a percentage of NA values above cols_nan_threshold if(nrow(clean_features)) - clean_features <- clean_features %>% select_if(~ sum(is.na(.)) / length(.) <= cols_nan_threshold ) + clean_features <- clean_features %>% select(where(~ sum(is.na(.)) / length(.) <= cols_nan_threshold ), starts_with("phone_esm")) # Drop columns with zero variance if(drop_zero_variance_columns) - clean_features <- clean_features %>% select_if(grepl("pid|local_segment|local_segment_label|local_segment_start_datetime|local_segment_end_datetime",names(.)) | sapply(., n_distinct, na.rm = T) > 1) + clean_features <- clean_features %>% select_if(grepl("pid|local_segment|local_segment_label|local_segment_start_datetime|local_segment_end_datetime|phone_esm",names(.)) | sapply(., n_distinct, na.rm = T) > 1) # Drop highly correlated features if(as.logical(drop_highly_correlated_features$COMPUTE)){