SensDotPlot | R Documentation |
Plot of sensitivities of the neural network output respect to the inputs
SensDotPlot(
object,
fdata = NULL,
input_vars = "all",
output_vars = "all",
smooth = FALSE,
nspline = NULL,
color = NULL,
grid = FALSE,
...
)
object |
fitted neural network model or |
fdata |
|
input_vars |
|
output_vars |
|
smooth |
|
nspline |
|
color |
|
grid |
|
... |
further arguments that should be passed to |
list of geom_point
plots for the inputs variables representing the
sensitivity of each output respect to the inputs
## Load data -------------------------------------------------------------------
data("DAILY_DEMAND_TR")
fdata <- DAILY_DEMAND_TR
## Parameters of the NNET ------------------------------------------------------
hidden_neurons <- 5
iters <- 250
decay <- 0.1
################################################################################
######################### REGRESSION NNET #####################################
################################################################################
## Regression dataframe --------------------------------------------------------
# Scale the data
fdata.Reg.tr <- fdata[,2:ncol(fdata)]
fdata.Reg.tr[,3] <- fdata.Reg.tr[,3]/10
fdata.Reg.tr[,1] <- fdata.Reg.tr[,1]/1000
# Normalize the data for some models
preProc <- caret::preProcess(fdata.Reg.tr, method = c("center","scale"))
nntrData <- predict(preProc, fdata.Reg.tr)
#' ## TRAIN nnet NNET --------------------------------------------------------
# Create a formula to train NNET
form <- paste(names(fdata.Reg.tr)[2:ncol(fdata.Reg.tr)], collapse = " + ")
form <- formula(paste(names(fdata.Reg.tr)[1], form, sep = " ~ "))
set.seed(150)
nnetmod <- nnet::nnet(form,
data = nntrData,
linear.output = TRUE,
size = hidden_neurons,
decay = decay,
maxit = iters)
# Try SensDotPlot
NeuralSens::SensDotPlot(nnetmod, fdata = nntrData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.