1. Home
  2. BRFPREDICT procedure

BRFPREDICT procedure

Makes predictions using a random regression forest (R.W. Payne).

Options

PRINT = string token Controls printed output (prediction); default pred
PREDICTION = variate Saves the prediction for the observations
SAVE = pointer Save structure from BRFOREST providing information about the random forest

Parameters

X = variates or factors Explanatory variables
VALUES = scalars, variates or texts Values to use for the explanatory variables; if these are unset for any variable, its existing values are used

Description

BRFPREDICT makes predictions using a regression forest, as constructed by the BRFOREST procedure. The SAVE parameter can be set to a pointer, saved using the SAVE option of BRFOREST, containing the necessary information about the forest. Alternatively, if you do not set SAVE, BRFPREDICT will use the forest most recently constructed by BRFOREST.

The x-values for the predictions can be specified in the variates listed by the X parameter. These must have identical names (and levels) to those used originally to construct the tree. You can use the VALUES parameter to supply new values, if those stored in any of the variates or factors are unsuitable.

By default, BRFPREDICT prints the predictions, but you can set option PRINT=* to suppress this. The PREDICTION option allows you to save the predictions.

Options: PRINT, PREDICTION, SAVE.

Parameters: X, VALUES.

Method

BRFPREDICT takes the mean of predictions from the individual trees, made using BIDENTIFY.

Action with RESTRICT

Restrictions are ignored.

See also

Procedures: BRFOREST, BRFDISPLAY, BREGRESSION, BRPREDICT.

Commands for: Regression analysis, Multivariate and cluster analysis.

Example

CAPTION    'BRFPREDICT example'; STYLE=meta
SPLOAD     [PRINT=*] '%gendir%/data/water.gsh'
BRFOREST   [PRINT=outofbagerror,youtofbagestimates,importance;\
           Y=Water; NTREES=8; NXTRY=3; NUNITSTRY=10; SEED=185090]\
           Employ,Opdays,Product,Temp
BRFPREDICT [PREDICTION=prediction] Opdays,Product,Temp;\
           VALUES=!(20,23,20),!(11.96,13.53,12.66),!(71.90,63.90,54.50)
Updated on June 20, 2019

Was this article helpful?