bartz.stochtree.TreatmentEffectForestParams

class bartz.stochtree.TreatmentEffectForestParams(*, num_trees=100, alpha=0.25, beta=3.0, min_samples_leaf=5, keep_vars=None, drop_vars=None, max_depth=5, sample_sigma2_leaf=False, sigma2_leaf_init=None, sigma2_leaf_shape=3.0, sigma2_leaf_scale=None, delta_max=0.9, sample_intercept=True, tau_0_prior_var=None)[source]

Mirror of stochtree’s treatment_effect_forest_params dict, restricted to the keys bartz handles.

num_trees: int = 100

Number of trees in the treatment effect forest.

alpha: float | Float[Array, ''] | Float[ndarray, ''] = 0.25

Tree split prior base.

beta: float | Float[Array, ''] | Float[ndarray, ''] = 3.0

Tree split prior decay.

max_depth: int = 5

Maximum tree depth. Must be a non-negative integer at most 16.

sample_sigma2_leaf: bool = False

Whether to sample the leaf variance with an inverse-gamma prior, or hold it fixed at sigma2_leaf_init.

sigma2_leaf_init: float | Float[Array, ''] | Float[ndarray, ''] | None = None

Initial leaf variance. If None, matches stochtree’s defaults of var(resid_train) / (2 * num_trees) for continuous and square(delta_max / (q * phi(0))) / num_trees for probit, with q = Phi^-1(0.84135) ≈ 1.

sigma2_leaf_scale: float | Float[Array, ''] | Float[ndarray, ''] | None = None

Twice the scale parameter of the inverse-gamma prior on the leaf variance. If None, defaults to var(resid_train) / (2 * num_trees) for continuous and 1 / (2 * num_trees) for probit.

delta_max: float | Float[Array, ''] | Float[ndarray, ''] = 0.9

Maximum plausible treatment effect on the probability scale, setting the default sigma2_leaf_init for probit.

sample_intercept: bool = True

Whether to sample a global treatment effect intercept tau_0, included in the treatment effect.

tau_0_prior_var: float | Float[Array, ''] | Float[ndarray, ''] | None = None

Variance of the normal prior on tau_0. If None, var(resid_train).

drop_vars: Sequence[str] | Sequence[int] | Shaped[ndarray, 'k_drop'] | Integer[Array, 'k_drop'] | Series | None = None

Names (for dataframes) or indices of covariates the trees may not split on. Ignored if keep_vars is set.

keep_vars: Sequence[str] | Sequence[int] | Shaped[ndarray, 'k_keep'] | Integer[Array, 'k_keep'] | Series | None = None

Names (for dataframes) or indices of the only covariates the trees may split on.

min_samples_leaf: int = 5

Minimum number of training samples at a leaf.

sigma2_leaf_shape: float | Float[Array, ''] | Float[ndarray, ''] = 3.0

Twice the shape parameter of the inverse-gamma prior on the leaf variance, i.e., the prior is IG(sigma2_leaf_shape / 2, sigma2_leaf_scale / 2).