Skip to content

Commit

Permalink
more imputation work
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax committed Dec 9, 2024
1 parent d17223c commit 098a44a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export(createRandomForestFeatureSelection)
export(createRareFeatureRemover)
export(createRestrictPlpDataSettings)
export(createSampleSettings)
export(createSklearnImputer)
export(createSplineSettings)
export(createStratifiedImputationSettings)
export(createStudyPopulation)
Expand Down
3 changes: 2 additions & 1 deletion R/PreprocessingData.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ minMaxNormalize <- function(trainData, featureEngineeringSettings, normalized =
min = min(.data$covariateValue, na.rm = TRUE)
) %>%
dplyr::collect()
on.exit(trainData$covariateData$minMaxs <- NULL, add = TRUE)

# save the normalization
attr(featureEngineeringSettings, "minMaxs") <-
Expand Down Expand Up @@ -193,6 +194,7 @@ robustNormalize <- function(trainData, featureEngineeringSettings, normalized =
dplyr::mutate(iqr = .data$q75 - .data$q25) %>%
dplyr::select(-c("q75", "q25")) %>%
dplyr::collect()
on.exit(trainData$covariateData$quantiles <- NULL, add = TRUE)

# save the normalization
attr(featureEngineeringSettings, "quantiles") <-
Expand All @@ -213,7 +215,6 @@ robustNormalize <- function(trainData, featureEngineeringSettings, normalized =
.data$covariateValue
)) %>%
dplyr::select(-c("median", "iqr"))
trainData$covariateData$quantiles <- NULL
normalized <- TRUE
} else {
# apply the normalization to test data by using saved normalization values
Expand Down

0 comments on commit 098a44a

Please sign in to comment.