createMixedSimulation: Create a data simulation with a mix of main and interaction...

Description Usage Arguments Value See Also Examples

View source: R/simulation.R

Description

Create a data simulation with a mix of main and interaction effects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
createMixedSimulation(
  num.samples = 100,
  num.variables = 100,
  pct.imbalance = 0.5,
  pct.signals = 0.1,
  bias = 0.4,
  label = "class",
  pct.mixed = 0.5,
  mixed.type = c("mainEffect", "interactionScalefree"),
  pct.train = 0.5,
  pct.holdout = 0.5,
  pct.validation = 0,
  save.file = NULL,
  verbose = FALSE
)

Arguments

num.samples

An integer for the number of samples

num.variables

An integer for the number of variables

pct.imbalance

A numeric percentage to indicate proportion of the imbalaced samples. 0 means all controls and 1 mean all cases.

pct.signals

A numeric for proportion of simulated signal variables

bias

A numeric for effect size in simulated signal variables

label

A character vector for the name of the outcome column. class for classification and qtrait for regression

pct.mixed

A numeric percentage to indicate the proportion of each simulation type

mixed.type

A character vector of the mix type of simulations: mainEffect, interactionErdos/interactionScalefree

pct.train

A numeric percentage of samples to use for traning

pct.holdout

A numeric percentage of samples to use for holdout

pct.validation

A numeric percentage of samples to use for testing

save.file

A filename or NULL indicating whether to save the simulations to file

verbose

A flag indicating whether verbose output be sent to stdout

Value

A list with:

train

traing data set

holdout

holdout data set

validation

validation data set

label

the class label/column name

signal.names

the variable names with simulated signals

elapsed

total elapsed time

See Also

Other simulation: createInteractions(), createMainEffects(), createSimulation(), splitDataset()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
num.variables <- 100
num.samples <- 100
pct.imbalance <- 0.5
pct.signals <- 0.1
bias <- 0.4
label <- "class"
pct.mixed <- 0.5
mixed.type <- c("mainEffect", "interactionScalefree")
sim.data <- createMixedSimulation(num.samples=num.samples,
                                  num.variables=num.variables,
                                  pct.signals=pct.signals,
                                  pct.imbalance=pct.imbalance,
                                  label = label,
                                  bias=bias,
                                  pct.mixed=pct.mixed,
                                  mixed.type=mixed.type,
                                  verbose=FALSE)

insilico/privateEC documentation built on May 22, 2020, 5:12 p.m.