Description Arguments Details Value Author(s) See Also Examples
The function
1 |
may be provided
by the user for initializing the computation of the slave
processes. It's definition has to be given in the same file in which
the functions race.wrapper
and race.info
are defined.
The name of such file has to be passed as first argument to the
function race
.
The function race.init
has to be called with no
arguments.
This function should be used for initializing the computation
on each slave, e.g. loading libraries or data needed by
race.wrapper
, race.info
, and/or
race.describe
. The output of
race.init
will be passed to these functions.
The function race.init
is expected to return an object of
mode list.
Mauro Birattari
race
, race.wrapper
,
race.info
, race.describe
1 2 3 4 5 6 |
function ()
{
library(nnet)
data(iris)
k <- 15
n <- nrow(iris)
if (exists(".Random.seed"))
save.seed <- .Random.seed
set.seed(0)
smpl <- sample(n)
if (exists("save.seed", inherits = FALSE))
assign(".Random.seed", save.seed, envir = globalenv())
else rm(".Random.seed", envir = globalenv())
msk <- k * c(0:(ceiling(n/k) - 1))
candidates <- expand.grid(size = c(1:10), decay = c(1:5) *
1e-04)
return(list(no.candidates = nrow(candidates), no.tasks = k,
msk = msk, smpl = smpl, iris = iris, candidates = candidates))
}
<environment: 0x1c46540>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.