Bayesian Additive Regression Trees Action Set
The bartScoreMargin Action
The bartScoreMargin action takes a model that was previously fit and stored by the bartGauss action and computes predictive margins (Lane and Nelder 1982). The predictive margins are obtained by fixing the value of one or more input variables and averaging predicted values over the distribution of covariates in an input data table. The input data table that is provided to the bartScoreMargin action can be different from the data table that is used to train the stored model.
If the original model was fitted to data by using BY groups, the new input data must use the same BY variables and BY-group values.
The bartScoreMargin action provides the following features:
provides control options for specifying predictive margins that intervene on one or more of the input variables
supports the computation of differences between predictive margins
provides an output data table that has predicted marginal means from each saved sample of the ensemble