Identifies deterministic rule-of-three conversions (e.g. Hematocrit = 3 * Hemoglobin),
constant offsets, and collinear features to eliminate redundant covariates before modeling.
Usage
detect_redundant_features(df, cols = NULL, tol = 0.001, corr_threshold = 0.999)
Arguments
- df
Input feature matrix data frame.
- cols
Optional vector of column names to check (defaults to numeric non-ID columns).
- tol
Relative tolerance for checking constant ratio or difference (default 1e-3).
- corr_threshold
Pearson correlation threshold flagging near-perfect collinearity (default 0.999).
Value
A data frame with columns:
feature_1, feature_2, redundancy_type, metric_value,
identical_missingness, recommendation.