From e77779566e4fa0fbae616c20182517d2b04a8f6d Mon Sep 17 00:00:00 2001 From: Solon Ioannou Date: Mon, 2 Dec 2024 13:39:28 +0100 Subject: [PATCH 1/4] chnaged `numberOutcometoNonOutcome` description --- R/Sampling.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Sampling.R b/R/Sampling.R index f97b024e0..352c42a6e 100644 --- a/R/Sampling.R +++ b/R/Sampling.R @@ -26,7 +26,7 @@ #' \item 'underSample' Undersample the non-outcome class to make the data more ballanced #' \item 'overSample' Oversample the outcome class by adding in each outcome multiple times #' } -#' @param numberOutcomestoNonOutcomes (numeric) An numeric specifying the require number of non-outcomes per outcome +#' @param numberOutcomestoNonOutcomes (numeric) An numeric specifying the require number of outcomes per non-outcomes #' @param sampleSeed (numeric) A seed to use when splitting the data for reproducibility (if not set a random number will be generated) #' #' @return From c52fe30d45ab52bc55aa548546bdad3f426777d7 Mon Sep 17 00:00:00 2001 From: Solon Ioannou Date: Mon, 2 Dec 2024 13:40:12 +0100 Subject: [PATCH 2/4] Fixed spelling mistakes. --- R/Sampling.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/Sampling.R b/R/Sampling.R index 352c42a6e..dec822b83 100644 --- a/R/Sampling.R +++ b/R/Sampling.R @@ -23,10 +23,10 @@ #' #' @param type (character) Choice of: \itemize{ #' \item 'none' No sampling is applied - this is the default -#' \item 'underSample' Undersample the non-outcome class to make the data more ballanced +#' \item 'underSample' Undersample the non-outcome class to make the data more balanced #' \item 'overSample' Oversample the outcome class by adding in each outcome multiple times #' } -#' @param numberOutcomestoNonOutcomes (numeric) An numeric specifying the require number of outcomes per non-outcomes +#' @param numberOutcomestoNonOutcomes (numeric) A numeric specifying the required number of outcomes per non-outcomes #' @param sampleSeed (numeric) A seed to use when splitting the data for reproducibility (if not set a random number will be generated) #' #' @return From 97f55ec5e19e26937fced6bec4b6b17a0488bce6 Mon Sep 17 00:00:00 2001 From: Solon Ioannou Date: Mon, 2 Dec 2024 13:41:17 +0100 Subject: [PATCH 3/4] Update documentation files. --- man/createSampleSettings.Rd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/createSampleSettings.Rd b/man/createSampleSettings.Rd index 9c8d0b918..1f5405b22 100644 --- a/man/createSampleSettings.Rd +++ b/man/createSampleSettings.Rd @@ -14,11 +14,11 @@ createSampleSettings( \arguments{ \item{type}{(character) Choice of: \itemize{ \item 'none' No sampling is applied - this is the default -\item 'underSample' Undersample the non-outcome class to make the data more ballanced +\item 'underSample' Undersample the non-outcome class to make the data more balanced \item 'overSample' Oversample the outcome class by adding in each outcome multiple times }} -\item{numberOutcomestoNonOutcomes}{(numeric) An numeric specifying the require number of non-outcomes per outcome} +\item{numberOutcomestoNonOutcomes}{(numeric) A numeric specifying the required number of outcomes per non-outcomes} \item{sampleSeed}{(numeric) A seed to use when splitting the data for reproducibility (if not set a random number will be generated)} } From b55dd3f7ccf82602d61c63ffa1e5e12bc67c6157 Mon Sep 17 00:00:00 2001 From: Solon Ioannou Date: Mon, 2 Dec 2024 13:43:26 +0100 Subject: [PATCH 4/4] Added a warning for changes in documentation. --- R/Sampling.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/Sampling.R b/R/Sampling.R index dec822b83..0f595fd66 100644 --- a/R/Sampling.R +++ b/R/Sampling.R @@ -44,6 +44,10 @@ createSampleSettings <- function(type = 'none', stop('Incorrect type. Pick: none/underSample/overSample') } + if(type %in% c('underSample', 'overSample')){ + ParallelLogger::logWarn('The previous documentation for `numberOutcomestoNonOutcomes` used to not reflect the functionality and has now been changed. The user needs to make sure the code is not relying on what was in the docs previously.') + } + sampleSettings <- list( numberOutcomestoNonOutcomes = numberOutcomestoNonOutcomes, sampleSeed = ifelse(type == 'none', 1, sampleSeed) # to make it the same for none