11. BART¶
This submodule contains a class to set up a Gaussian process regression with the
BART
kernel. See the bart and barteasy examples.
- class lsqfitgp.bayestree.bart(x_train, y_train, *, x_test=None, fitkw={}, kernelkw={})¶
GP version of BART.
Evaluate a Gaussian process regression with a kernel which accurately approximates the infinite trees limit of BART. The hyperparameters are optimized to their marginal MAP.
- Parameters:
- x_train(n, p) array or dataframe
Observed covariates.
- y_train(n,) array
Observed outcomes.
- x_test(n*, p) array or dataframe, optional
Covariates of outcomes to be imputed.
- fitkwdict
Additional arguments passed to
empbayes_fit
, overrides the defaults.- kernelkwdict
Additional arguments passed to
BART
, overrides the defaults.
See also
Notes
The tree splitting grid is set using quantiles of the observed covariates. This corresponds to settings
usequants=True
,numcut=inf
in the R packages BayesTree and BART.- Attributes:
- yhat_train_mean(n,) array
The posterior mean of the latent regression function at the observed covariates.
- yhat_train_var(n,) array
The posterior variance of the latent regression function at the observed covariates.
- yhat_test_mean(n*,) array
The posterior mean of the latent regression function at the covariates of imputed outcomes.
- yhat_test_var(n*,) array
The posterior variance of the latent regression function at the covariates of imputed outcomes.
- sigmagvar
The error term standard deviation.
- alphagvar
The numerator of the tree spawn probability (named
base
in BayesTree and BART).- betagvar
The depth exponent of the tree spawn probability (named
power
in BayesTree and BART).- meansdevgvar
The prior standard deviation of the latent regression function.
- fitempbayes_fit
The hyperparameters fit object.
- gpGP
The centered Gaussian process object constructed at the hyperparameters MAP. Its keys are ‘trainmean’ and ‘testmean’.
- muscalar
The prior mean.