# Load libraries
library(parsnip)
library(nnet)
# Create and fit model
nnet_fit <- mlp("classification", hidden_units = 2) %>%
set_engine("nnet") %>%
fit(Species ~ ., data = iris)
out <- butcher(nnet_fit, verbose = TRUE)
# Another nnet object
targets <- class.ind(c(rep("setosa", 50),
rep("versicolor", 50),
rep("virginica", 50)))
fit <- nnet(iris[,1:4],
targets,
size = 2,
rang = 0.1,
decay = 5e-4,
maxit = 20)
out <- butcher(fit, verbose = TRUE)
Run the code above in your browser using DataLab