1
$\begingroup$

When transforming numerical variables into categorical variables I'm not aware of when should I use equal frequency binning and when equal width binning. Seems that each of them has their own advantages but I can't distinguish them.

$\endgroup$
2
  • 2
    $\begingroup$ What's the purpose of binning here? Often, it's best not to discretize data at all. But, you'd have to say more about how you plan to use the discretized values. $\endgroup$ – user20160 Dec 9 '19 at 21:14
  • 1
    $\begingroup$ There are plenty of other binning methods, too: various forms of clustering (such as Jenks' method); by multiples of a standard deviation; by N-letter values; and more. $\endgroup$ – whuber Dec 9 '19 at 23:10
1
$\begingroup$

Binning is something I would rarely do myself on data. Many algorithms will bin continuous data for performance (XGboost, LGBM, ...) but the way they bin to create histograms is not as trivial as equal width or frequency.

In general, however, equal width is better for graphical representations (histograms) and is more intuitive, but it might have problems if the data is not evenly distributed, it's sparse, or has outliers, as you will have many empty, useless bins. Equal frequency will instead guarantee that every bin contains the roughly the same amount of data, which is usually preferable if you have to then use the data in any kind of model/algorithm as bins will be more significative in representing the underlying distribution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.