object: fitted neural network model or array containing the raw sensitivities from the function SensAnalysisMLP
fdata: data.frame containing the data to evaluate the sensitivity of the model.
input_vars: character vector with the variables to create the scatter plot. If "all", then scatter plots are created for all the input variables in fdata.
output_vars: character vector with the variables to create the scatter plot. If "all", then scatter plots are created for all the output variables in fdata.
smooth: logical if TRUE, geom_smooth plots are added to each variable plot
nspline: integer if smooth is TRUE, this determine the degree of the spline used to perform geom_smooth. If nspline is NULL, the square root of the length of the data is used as degrees of the spline.
color: character specifying the name of a numeric variable of fdata to color the scatter plot.
grid: logical. If TRUE, plots created are show together using arrangeGrob
...: further arguments that should be passed to SensAnalysisMLP function
Returns
list of geom_point plots for the inputs variables representing the sensitivity of each output respect to the inputs
Examples
## Load data -------------------------------------------------------------------data("DAILY_DEMAND_TR")fdata <- DAILY_DEMAND_TR
## Parameters of the NNET ------------------------------------------------------hidden_neurons <-5iters <-250decay <-0.1######################################################################################################### REGRESSION NNET ####################################################################################################################### Regression dataframe --------------------------------------------------------# Scale the datafdata.Reg.tr <- fdata[,2:ncol(fdata)]fdata.Reg.tr[,3]<- fdata.Reg.tr[,3]/10fdata.Reg.tr[,1]<- fdata.Reg.tr[,1]/1000# Normalize the data for some modelspreProc <- caret::preProcess(fdata.Reg.tr, method = c("center","scale"))nntrData <- predict(preProc, fdata.Reg.tr)#' ## TRAIN nnet NNET --------------------------------------------------------# Create a formula to train NNETform <- 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 SensDotPlotNeuralSens::SensDotPlot(nnetmod, fdata = nntrData)