Mean target encoding replaces each category with the mean target value associated with that category, usually with some regularization. It offers an alternative to one-hot, ordinal, and hashing-based encodings for categorical features. section 11.1.2 section 11.1.3
Use it with an explicit leakage check:
- Treat the encoded category statistic as a feature for the downstream model. section 11.1.3
- Prevent the encoding from using target information unavailable during inference; otherwise, overfitting and poor new-data performance can result. section 11.1.2 section 11.1.3
- Use advanced validation techniques such as nested cross-validation when evaluating the feature. section 11.1.3
Categorical features in ETA prediction
An ETA system can combine continuous, categorical, and geospatial inputs. Categorical inputs may be transformed through mean target encoding or other categorical encodings before entering a machine-learning model; DeepETA illustrates a broader pipeline that converts diverse tabular inputs into discrete tokens and learnable embeddings. section 11.1.2


