Skip to contents

Returns 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_tree from oda_cta_fit.

...

Unused.

Value

A list of class "cta_tree_summary" with fields:

status

Character: "valid_tree", "stump", or "no_tree".

no_tree

Logical; TRUE for leaf-only fits.

root_attribute

Character attribute name at the root split; NA_character_ for no-tree fits.

n_nodes

Total number of nodes including leaves.

n_splits

Number of non-leaf (split) nodes.

n_leaves

Number of terminal leaf endpoints (= strata).

strata

Alias for n_leaves; NA_integer_ for no-tree fits.

overall_ess

WESS when weights are active, ESS otherwise; NA_real_ when absent.

d

D statistic (NA_real_ for no-tree or ESS \(\le\) 0).

min_terminal_denom

Smallest leaf n_obs; NA_integer_ for no-tree fits.

endpoint_denominators

Named integer vector of leaf n_obs; integer(0) for no-tree fits.

has_weights

Logical; TRUE when case weights are active.

mindenom

MINDENOM used when fitting.

alpha_split

Significance threshold used when fitting.

prune_alpha

Pruning threshold used when fitting.

loo

LOO 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
#>