plot.BayesNnet {BoomSpikeSlab}R Documentation

Plot a Bayesian Neural Network


The default plot is a barplot of the marginal inclusion probabilities for each variable, as obtained by PlotMarginalInclusionProbabilities. Other interesting plots can be obtained by supplying a string as the second argument.


  ## S3 method for class 'BayesNnet'
     y = c("predicted", "residual", "structure", "partial", "help"),

  PlotBayesNnetPredictions(model, burn = SuggestBurn(model), ...)

  PlotBayesNnetResiduals(model, burn = SuggestBurn(model), ...)

  PlotNetworkStructure(model, ...)



An object of class BayesNnet.


An object of class BayesNnet. The name x is required to conform with the plot generic function signature.


The type of plot desired, or the name of the variable to plot against. The name y is required to conform with the plot generic function signature.

If y matches (or partially matches) one of the names in the function signature, then the corresponding plot function handles the plot request.

  • "predicted" (the default) plot actual vs predicted values using PlotBayesNnetPredictions.

  • "residual" plot residuals vs predicted values using PlotBayesNnetResiduals.

  • "structure" plot network structure using PlotNetworkStructure.

  • "partial" Draw the partial dependence plot for each predictor variable in the training data. This is an expensive plot. It might take a while to draw for large data sets or complex models.

  • "help" show this help page in a browser

If y fails to match any of the above, but it (partially) the name of one of the variables in the training data, then a partial dependence plot vs that variable is produced.


The number of MCMC iterations to discard as burn-in.


Additional arguments passed to the specific functions that do the plotting. For residual and predicted plots that is the plot function. For network structure it is plot.igraph. For partial dependence plots it is PartialDependencePlot.


Residual and predicted plots should be self explanatory. The network structure plot is fairly standard for neural network models. The width of a line linking two nodes is determined by the absolute value of the corresponding coefficient.


Steven L. Scott

See Also

BayesNnet PartialDependencePlot


  ## See the examples in ?BayesNnet

[Package BoomSpikeSlab version 1.2.6 Index]