Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Under sample data documentation fix #506

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading