Skip to content

Commit

Permalink
Merge pull request #506 from solisOHDSI/underSampleData_documentationFix
Browse files Browse the repository at this point in the history
Under sample data documentation fix
  • Loading branch information
egillax authored Dec 4, 2024
2 parents 44da0fb + b55dd3f commit 4c7dddd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions R/Sampling.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions man/createSampleSettings.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c7dddd

Please sign in to comment.