View source: R/parallelisation.R
| Combine | R Documentation |
Merges the outputs from two runs of VariableSelection,
GraphicalModel or Clustering. The two runs must
have been done using the same methods and the same params but
with different seeds. The combined output will contain results based
on iterations from both stability1 and stability2. This
function can be used for parallelisation.
Combine(stability1, stability2, include_beta = TRUE)
stability1 |
output from a first run of |
stability2 |
output from a second run of
|
include_beta |
logical indicating if the beta coefficients of visited models should be concatenated. Only applicable to variable selection or clustering. |
A single output of the same format.
VariableSelection, GraphicalModel
## Variable selection
# Data simulation
set.seed(1)
simul <- SimulateRegression(n = 100, pk = 50, family = "gaussian")
# Two runs
stab1 <- VariableSelection(xdata = simul$xdata, ydata = simul$ydata, seed = 1, K = 10)
stab2 <- VariableSelection(xdata = simul$xdata, ydata = simul$ydata, seed = 2, K = 10)
# Merging the outputs
stab <- Combine(stability1 = stab1, stability2 = stab2, include_beta = FALSE)
str(stab)
## Graphical modelling
# Data simulation
simul <- SimulateGraphical(pk = 20)
# Two runs
stab1 <- GraphicalModel(xdata = simul$data, seed = 1, K = 10)
stab2 <- GraphicalModel(xdata = simul$data, seed = 2, K = 10)
# Merging the outputs
stab <- Combine(stability1 = stab1, stability2 = stab2)
str(stab)
## Clustering
# Data simulation
simul <- SimulateClustering(n = c(15, 15, 15))
# Two runs
stab1 <- Clustering(xdata = simul$data, seed = 1)
stab2 <- Clustering(xdata = simul$data, seed = 2)
# Merging the outputs
stab <- Combine(stability1 = stab1, stability2 = stab2)
str(stab)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.