The NeuralSens package is designed for performing sensitivity analysis of multi-layer perceptron (MLP) neural networks in R and Python. The package calculates the partial derivatives of the output with regard to the input variables of a MLP model, which helps in evaluating variable importance and understanding the relationships between input and output variables. This is useful for both simplifying neural network models by identifying and removing irrelevant inputs and gaining deeper insights into the model's behavior.
In the field of machine learning, understanding how input variables influence the output of a neural network model is crucial for improving model performance and interpretability. Sensitivity analysis provides insights into these relationships, allowing for the identification of key variables and the simplification of complex models.
NeuralSens is an R and Python package that facilitates sensitivity analysis of Multi-Layer Perceptron (MLP) models using the partial derivatives method. It calculates the partial derivatives of the output with respect to the input variables of a MLP model. This information is used to assess variable importance and to understand the intricate relationships between inputs and outputs.
The NeuralSens package requires the following inputs to perform sensitivity analysis:
After the partial derivatives are calculated, the expected outputs are:
By utilizing the NeuralSens package, users can gain a deeper understanding of their neural network models, identify key input variables, and enhance model interpretability, ultimately leading to more effective and efficient machine learning solutions.
NeuralSens application
To facilitate and illustrate the use of the NeuralSens library, an application based on Shiny has been developed. This application provides an easy-to-use interface to perform sensitivity analysis and visualize results without requiring advanced programming knowledge.
The application is sponsored by the Santalucía Chair of Analytics for Education at the Universidad Pontificia Comillas. You can download the app for Windows and MacOS from the following links:
To obtain more information about the Santalucía Chair of Analytics for Education, click here.
Projects
Journal publications
[1] Pizarroso, J., Portela, J., & Muñoz, A. (2022). NeuralSens: Sensitivity Analysis of Neural Networks. Journal of Statistical Software, 102(7), 1–36. https://doi.org/10.18637/jss.v102.i07
[2] Pizarroso, J., Alfaya, D., Portela, J., & Muñoz, A. (2024). Metric Tools for Sensitivity Analysis. arXiv:2305.02368
Useful links