Computes the concentration-index impurity reduction from a root partition to
groups defined by terminal-node ids or another supplied partition column.
This is the yardstick-compatible counterpart to ci_tree_validation_gain().
Usage
ci_gain_vec(
truth,
estimate,
rank,
node = NULL,
case_weights = NULL,
type = "CIg",
root_impurity = NULL,
na_rm = TRUE,
...
)Arguments
- truth
Numeric or logical observed outcomes.
- estimate
Numeric predictions. Used as the partition only when
nodeisNULL.- rank
Socioeconomic rank values.
- node
Optional terminal-node or partition ids. True CI gain requires a partition; using predictions as a fallback is only an approximation.
- case_weights
Optional non-negative case weights.
- type
One of
"CI","CIg","CIc", or"L".- root_impurity
Optional pre-computed root impurity.
- na_rm
Should incomplete rows be removed?
- ...
Not used.