Skip to contents

Plot of sensitivity of the neural network output respect to the inputs over the time variable from the data provided

Usage

CombineSens(object, comb_type = "mean")

Arguments

object

SensMLP object generated by SensAnalysisMLP with several outputs (classification MLP)

comb_type

Function to combine the matrixes of the raw_sens component of object. It can be "mean", "median" or "sqmean". It can also be a function to combine the rows of the matrixes

Value

SensMLP object with the sensitivities combined

Examples

# \donttest{
fdata <- iris
## Parameters of the NNET ------------------------------------------------------
hidden_neurons <- 5
iters <- 250
decay <- 0.1

#' ## TRAIN nnet NNET --------------------------------------------------------
# Create a formula to train NNET
form <- paste(names(fdata)[1:ncol(fdata)-1], collapse = " + ")
form <- formula(paste(names(fdata)[5], form, sep = " ~ "))

set.seed(150)
mod <- nnet::nnet(form,
                  data = fdata,
                  linear.output = TRUE,
                  size = hidden_neurons,
                  decay = decay,
                  maxit = iters)
#> # weights:  43
#> initial  value 202.395197 
#> iter  10 value 89.434352
#> iter  20 value 69.265889
#> iter  30 value 30.753230
#> iter  40 value 23.999431
#> iter  50 value 23.111929
#> iter  60 value 23.041209
#> iter  70 value 23.013926
#> iter  80 value 23.007422
#> final  value 23.007413 
#> converged
# mod should be a neural network classification model
sens <- SensAnalysisMLP(mod, trData = fdata, output_name = 'Species')
#> Loading required namespace: ggforce
#> Warning: All aesthetics have length 1, but the data has 4 rows.
#>  Did you mean to use `annotate()`?
#> Warning: minimum occurred at one end of the range
#> Warning: minimum occurred at one end of the range
#> Warning: minimum occurred at one end of the range
#> Warning: minimum occurred at one end of the range

combinesens <- CombineSens(sens, "sqmean")
# }