bartz.BART.gbart

class bartz.BART.gbart(*args, **kwargs)[source]

Subclass of mc_gbart that forces mc_cores=1.

property ndpost: int[source]

The number of MCMC samples saved, after burn-in.

property offset: Float32[Array, ''][source]

The prior mean of the latent mean function.

predict(x_test)[source]

Evaluate the sum-of-trees at x_test for each MCMC iteration.

Parameters:

x_test (Real[Array, 'm p'] | Real[ndarray, 'm p'] | DataFrame) – The test predictors.

Returns:

Float32[Array, 'ndpost m'] – Posterior samples of the latent function value at x_test. In the continuous case, this is the conditional mean.

Raises:

ValueError – If x_test has a different format than x_train.

property prob_test: Float32[Array, 'ndpost m'] | None[source]

The posterior probability of y being True at x_test for each MCMC iteration.

property prob_test_mean: Float32[Array, 'm'] | None[source]

The marginal posterior probability of y being True at x_test.

property prob_train: Float32[Array, 'ndpost n'] | None[source]

The posterior probability of y being True at x_train for each MCMC iteration.

property prob_train_mean: Float32[Array, 'n'] | None[source]

The marginal posterior probability of y being True at x_train.

sigest: Float32[Array, ''] | None = None

The estimated standard deviation of the error used to set lambda_.

property sigma: Float32[Array, 'nskip_plus_ndpost'] | Float32[Array, 'nskip_plus_ndpost_per_core mc_cores'] | None[source]

The standard deviation of the error, including burn-in samples.

property sigma_: Float32[Array, 'ndpost'] | None[source]

The standard deviation of the error, only over the post-burnin samples and flattened.

property sigma_mean: Float32[Array, ''] | None[source]

The mean of sigma, only over the post-burnin samples.

property varcount: Int32[Array, 'ndpost p'][source]

Histogram of predictor usage for decision rules in the trees.

property varcount_mean: Float32[Array, 'p'][source]

Average of varcount across MCMC iterations.

property varprob: Float32[Array, 'ndpost p'][source]

Posterior samples of the probability of choosing each predictor for a decision rule.

property varprob_mean: Float32[Array, 'p'][source]

The marginal posterior probability of each predictor being chosen for a decision rule.

property yhat_test: Float32[Array, 'ndpost m'] | None[source]

The conditional posterior mean at x_test for each MCMC iteration.

property yhat_test_mean: Float32[Array, 'm'] | None[source]

The marginal posterior mean at x_test.

Not defined with binary regression because it’s error-prone, typically the right thing to consider would be prob_test_mean.

property yhat_train: Float32[Array, 'ndpost n'][source]

The conditional posterior mean at x_train for each MCMC iteration.

property yhat_train_mean: Float32[Array, 'n'] | None[source]

The marginal posterior mean at x_train.

Not defined with binary regression because it’s error-prone, typically the right thing to consider would be prob_train_mean.