End tail imputation with Feature-engine

Опубликовано: 26 Март 2026
на канале: Soledad Galli | Data Scientist @ Train in Data
363
4

In some cases, it is useful to replace missing data in numerical variables by a value very different from the remaining values of the variable. This is equivalent to replacing by an arbitrary value, but the arbitrary value is found automatically by an algorithm that looks at the distribution of the variable, and selects a value that is far out at any tail of the distribution.


The EndTailImputer() from Feature-engine replaces missing data with a value at the end of the distribution. The value can be determined using the mean plus or minus a number of times the standard deviation, or using the inter-quartile range proximity rule. The value can also be determined as a factor of the maximum value.



The user decides whether the missing data should be placed at the right or left tail of the variable distribution.

The EndTailImputer() from Feature-engine works only with numerical variables. A list of variables can be indicated, or the imputer will automatically select all numerical variables in the train set.