diff --git a/R/Sampling.R b/R/Sampling.R index f97b024e..0f595fd6 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 non-outcomes per outcome +#' @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 @@ -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 diff --git a/man/createSampleSettings.Rd b/man/createSampleSettings.Rd index 9c8d0b91..1f5405b2 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)} }