## a simple lm
data(neuraldat)
mod <- lm(Y1 ~ X1 + X2 + X3, data = neuraldat)
lekprofile(mod)
## using nnet
library(nnet)
set.seed(123)
mod <- nnet(Y1 ~ X1 + X2 + X3, data = neuraldat, size = 5)
lekprofile(mod)
## 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, exp_in = x)
## back to nnet, not using formula to create model
## y variable must a name attribute
mod <- nnet(x, y, data = neuraldat, size = 5)
lekprofile(mod)
## using caret
library(caret)
mod <- train(Y1 ~ X1 + X2 + X3, method = 'nnet', data = neuraldat, linout = TRUE)
lekprofile(mod)Run the code above in your browser using DataLab