bartz.stochtree.PrognosticForestParams¶
- class bartz.stochtree.PrognosticForestParams(*, num_trees=250, alpha=0.95, beta=2.0, min_samples_leaf=5, keep_vars=None, drop_vars=None, max_depth=10, sample_sigma2_leaf=True, sigma2_leaf_init=None, sigma2_leaf_shape=3.0, sigma2_leaf_scale=None)[source]¶
Mirror of stochtree’s
prognostic_forest_paramsdict, restricted to the keys bartz handles.- sigma2_leaf_init: float | Float[Array, ''] | Float[ndarray, ''] | None = None¶
Initial leaf variance. If
None, matches stochtree’s defaults of2 * var(resid_train) / num_treesfor continuous and1 / num_treesfor probit.
- 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 tovar(resid_train) / num_treesfor continuous and1 / num_treesfor probit.
- 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_varsis 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.
- sample_sigma2_leaf: bool = True¶
Whether to sample the leaf variance with an inverse-gamma prior, or hold it fixed at
sigma2_leaf_init.