## Why does frequency encoding work?

12

2

Frequency encoding is a widely used technique in Kaggle competitions, and many times proves to be a very reasonable way of dealing with categorical features with high cardinality. I really don't understand why it works.

Does it work in very specific cases where frequencies are correlated with the target or is it more general? What's the rationale behind it?

– Nikos M. – 2020-07-26T08:26:24.413

@NikosM. Can you copy that answer here? – Itamar Mushkin – 2020-07-30T07:14:11.277

7

Check this post.

In the cases where the frequency is related somewhat with the target variable, it helps the model to understand and assign the weight in direct and inverse proportion, depending on the nature of the data.