Description Usage Arguments Value See Also Examples
This function creates a caret
model description to enable training
DArch
instances with the train
function. See the
documentation on custom caret models for further information and examples on
how to create valid params
and grid
values.
1 | darchModelInfo(params = NULL, grid = NULL)
|
params |
|
grid |
Function which procuces a |
A valid caret
model which can be passed to
train
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
data(iris)
tc <- trainControl(method = "boot", number = 5, allowParallel = F,
verboseIter = T)
parameters <- data.frame(parameter = c("layers", "bp.learnRate", "darch.unitFunction"),
class = c("character", "numeric", "character"),
label = c("Network structure", "Learning rate", "unitFunction"))
grid <- function(x, y, len = NULL, search = "grid")
{
df <- expand.grid(layers = c("c(0,20,0)","c(0,10,10,0)","c(0,10,5,5,0)"),
bp.learnRate = c(1,2,5,10))
df[["darch.unitFunction"]] <- rep(c("c(tanhUnit, softmaxUnit)",
"c(tanhUnit, tanhUnit, softmaxUnit)",
"c(tanhUnit, tanhUnit, tanhUnit, softmaxUnit)"), 4)
df
}
caretModel <- train(Species ~ ., data = iris, tuneLength = 12, trControl = tc,
method = darchModelInfo(parameters, grid), preProc = c("center", "scale"),
darch.numEpochs = 15, darch.batchSize = 6, testing = T, ...)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.