Select chain responses by a shadow comparison
activeByShadow.RdSelect chain-feature responses whose supplied importance is strictly greater than a same-row shadow importance in more than half of their rows. Use this table-only gate when each row contains the feature and shadow scores to be compared directly.
Arguments
- IMP
A
data.tablewith one row per comparison cell and required columnsfeature,normImportance, andshadowImportance.featuremust contain non-missing character names ending insuffix; both importance columns must be numeric on the same normalized-percentage scale. Extra columns are ignored. Values and row uniqueness are not validated.- suffix
A single non-missing, non-empty character suffix to remove from every
feature, default".o". Removal is positional: the function does not verify that names end in this suffix.
Value
A character vector of unique stripped response names in first-appearance order. It is empty when no response has a strict majority.
Gate definition
Each input row is one comparison cell; method, response, and dataset columns
are not inspected. A row is a success only when shadowImportance is not
missing and normImportance > shadowImportance. Equality is not a success.
For each stripped response name, the denominator is the full row count,
including duplicate rows and rows with a missing shadow score. The response
passes only when successes are strictly greater than half of that count, so
a tied half does not pass.
A missing shadowImportance counts as an unsuccessful row and remains in the
denominator. A missing normImportance paired with a present shadow makes
the group's success count NA, so that group is excluded. The helper assumes
that the two score columns are comparable within each row; it does not
establish comparability across learners or sources.
This strict-majority rule is ssel package policy. It uses a supplied shadow score as a reference but does not implement the iterative random-probe tests of the Boruta algorithm.
Validation and side effects
NULL, a zero-row table, or an input without shadowImportance returns
character(0). Otherwise a non-empty input must be a data.table; missing
feature or normImportance columns and incompatible types produce
underlying base R or data.table errors or warnings. The function does not
modify IMP by reference. It reads and writes no files, uses no random
numbers, and emits no message or warning for valid inputs.
References
Kursa, M. B. and Rudnicki, W. R. (2010). Feature Selection with the Boruta Package. Journal of Statistical Software, 36(11), 1–13. doi:10.18637/jss.v036.i11 .
See also
activeByImportance() for the inclusive fixed-threshold gate.
extractChainImportance() is the package table producer; its model-file
contract is separate from this table operation.
Examples
importance <- data.table::data.table(
feature = c("alpha.o", "alpha.o", "alpha.o",
"beta.o", "beta.o", "gamma.o", "gamma.o"),
normImportance = c(2, 3, 0, 2, 0, 2, 2),
shadowImportance = c(1, 1, 1, 1, 1, 1, NA)
)
# alpha wins 2/3 cells; beta ties 1/2; gamma's missing shadow counts.
activeByShadow(importance, suffix = ".o")
#> [1] "alpha"