Creates a structured directory hierarchy for storing machine learning results including matrices, performance metrics, feature importance, models, and predictions.
createMLResultDir(
path,
stratify_by = NULL,
LOO = FALSE,
cross_test = FALSE,
MDR = FALSE
)Character scalar. Base directory path where subdirectories will be created.
Character scalar or NULL. Stratification method: "country",
"year", or NULL. Default is NULL (no stratification).
Logical. Whether to create directories for Leave-One-Out analysis.
Default is FALSE. Only valid when stratify_by is not NULL.
Logical. Whether to create directories for cross-testing.
Default is FALSE.
Logical. Whether to create directories for Multi-Drug Resistance (MDR) analysis.
Default is FALSE. When TRUE, all other parameters must be FALSE/NULL.
A named list containing paths to:
Directory for input matrices
Directory for performance metrics
Directory for top feature rankings
Directory for saved model objects
Directory for prediction results
if (FALSE) { # \dontrun{
# Basic directory structure
paths <- createMLResultDir("/path/to/results")
# LOO analysis stratified by year
paths_loo <- createMLResultDir("/path/to/results",
stratify_by = "year",
LOO = TRUE)
# MDR analysis
paths_mdr <- createMLResultDir("/path/to/results", MDR = TRUE)
} # }