# NOT RUN {
## using nnet
library(nnet)
set.seed(123)
mod <- nnet(Y1 ~ X1 + X2 + X3, data = neuraldat, size = 5)
lekprofile(mod)
# }
# NOT RUN {
## using RSNNS, no bias layers
library(RSNNS)
x <- neuraldat[, c('X1', 'X2', 'X3')]
y <- neuraldat[, 'Y1', drop = FALSE]
mod <- mlp(x, y, size = 5)
lekprofile(mod, xvars = x)
## using neuralnet
library(neuralnet)
mod <- neuralnet(Y1 ~ X1 + X2 + X3, data = neuraldat, hidden = 5)
lekprofile(mod)
## back to nnet, not using formula to create model
## y variable must have a name attribute
mod <- nnet(x, y, size = 5)
lekprofile(mod)
## using caret
library(caret)
mod <- train(Y1 ~ X1 + X2 + X3, method = 'nnet', data = neuraldat, linout = TRUE)
lekprofile(mod)
## group by clusters instead of sequencing by quantiles
mod <- nnet(Y1 ~ X1 + X2 + X3, data = neuraldat, size = 5)
lekprofile(mod, group_vals = 6) # six clusters
## enter an arbitrary grouping scheme for the group values
## i.e. hold all values at 0.5
group_vals <- rbind(rep(0.5, length = ncol(x)))
group_vals <- data.frame(group_vals)
names(group_vals) <- names(group_vals)
lekprofile(mod, group_vals = group_vals, xsel = 'X3')
# }
Run the code above in your browser using DataLab