Summarize a fitted CTA tree
summary.cta_tree.RdReturns a structured list with class "cta_tree_summary" capturing
tree-level metadata. All fields are read directly from stored objects;
no refitting or prediction is performed.
Usage
# S3 method for class 'cta_tree'
summary(object, ...)Arguments
- object
A
cta_treefromoda_cta_fit.- ...
Unused.
Value
A list of class "cta_tree_summary" with fields:
statusCharacter:
"valid_tree","stump", or"no_tree".no_treeLogical;
TRUEfor leaf-only fits.root_attributeCharacter attribute name at the root split;
NA_character_for no-tree fits.n_nodesTotal number of nodes including leaves.
n_splitsNumber of non-leaf (split) nodes.
n_leavesNumber of terminal leaf endpoints (=
strata).strataAlias for
n_leaves;NA_integer_for no-tree fits.overall_essWESS when weights are active, ESS otherwise;
NA_real_when absent.dD statistic (
NA_real_for no-tree or ESS \(\le\) 0).min_terminal_denomSmallest leaf
n_obs;NA_integer_for no-tree fits.endpoint_denominatorsNamed integer vector of leaf
n_obs;integer(0)for no-tree fits.has_weightsLogical;
TRUEwhen case weights are active.mindenomMINDENOM used when fitting.
alpha_splitSignificance threshold used when fitting.
prune_alphaPruning threshold used when fitting.
looLOO mode string used when fitting.
Examples
data(mtcars)
X <- mtcars[, c("cyl", "disp", "hp", "wt")]
y <- as.integer(mtcars$am)
tree <- oda_cta_fit(X, y, mindenom = 5L, mc_iter = 500L, mc_seed = 42L)
s <- summary(tree)
print(s)
#>
#> CTA Tree Summary status=stump
#> mindenom=5 alpha_split=0.050 prune=1.000 loo=off
#> root: wt
#> nodes: 3 total (1 split 2 leaf)
#> overall_ess=81.78% D=0.4455 min_denom=14
#>