Returns the minimum number of total observations needed (one bug-drug combo) to have at least one observation of the rarer class in each CV fold or, in validation mode, across train/val/test.

calculateMinSamples(n_fold, split, res_prop, smallest_n_obs_rs = 1)

Arguments

n_fold

numeric Number of CV folds; must be >= 2 in CV mode

split

numeric Vector length 2: c(train_prop, val_prop). For pure CV we enforce c(1, 0). For classical splits: val > 0, test > 0.

res_prop

numeric Proportion of resistant genomes in the combo

smallest_n_obs_rs

numeric Minimum number of observations of the rarer class required per fold/partition. Default is 1.

Value

Minimum total observations required, adjusted by smallest_n_obs_rs