create_partitions: Use createDataPartition to create test/train sets and massage...

View source: R/classify.R

create_partitionsR Documentation

Use createDataPartition to create test/train sets and massage them a little.

Description

This will also do some massaging of the data to make it easier to work with for downstream tasks. Most notably, since I am mostly evaluating classifiers of clinical data to see how well they agree with extant annotations, I want to make sure the relevant columns are renamed in the testing sets.

Usage

create_partitions(
  full_df,
  interesting_meta,
  outcome_factor = "condition",
  p = 0.4,
  list = FALSE,
  times = 5
)

Arguments

full_df

Dataframe containing the measured data and relevant factors.

interesting_meta

Other metadata (maybe not needed)

outcome_factor

Name of the outcome column

p

Ratio to split trainer and testers.

list

Generate result as list or dataframe

times

How many times to iterate

See Also

https://topepo.github.io/caret/data-splitting.html#simple-splitting-based-on-the-outcome and https://github.com/compgenomr/book/blob/master/05-supervisedLearning.Rmd


elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.