An indicator variable is a binary data column whose two states record whether a condition is true. In tabular work, the states commonly appear as 0 and 1. The condition may be missingness, category membership, format validity, or another testable property. section 9.1 section 9.2.1
For missing data, create one indicator per original column before imputation. The indicator preserves the information that a value was absent, while the original column can be filled with a median, mode, or other detector-compatible value. A row-level count can additionally indicate how many values are missing. section 9.1
Indicator variables also represent categorical membership. One-hot encoding creates a binary column for every distinct category, allowing categorical values to enter many outlier detectors. This representation is useful but can overweight high-cardinality categorical features, especially for random-feature methods and distance calculations. section 9.4.1
Common indicator-variable patterns include:
- Missingness indicator: records whether an original value is null or not null. section 9.1
- Category indicator: records membership in one category, such as a department, account, color, or size. section 9.4.1
- Validity or pattern indicator: records whether a value matches an expected format, such as a phone-number pattern. section 9.2.1
Missingness indicators for a table
Given columns A and B, derive A Null and B Null with isna(), derive Num Null by counting missing cells across each row, and then impute A and B separately. The indicators retain missingness as a signal for later detection. section 9.1



