I am reading Hands-On Machine Learning with Scikit-Learn and TensorFlow (76/718), and the author is talking about dividing the dataset into a test set which i follow, but then goes on to talk about strata with this test set, and divides median household income by 1.5.

Can anyone help out as to why he has divided by 1.5 it is really bugging me because he has not explained it! I would really appreciate it :)

  • 1
    $\begingroup$ The author explain it: "to limit the number of income categories". Have you tried removing the 1.5 factor ? what did it do ? $\endgroup$ – were_cat Feb 11 at 13:32

As the author states in the text, because there is a long tail of incomes on the right side of the distribution, he divided by 1.5 in order to "concentrate" that long tail inside 1-2 categories and to avoid having a lot of bins with very few datapoints because of the tail. Why by 1.5? It is somewhat arbitrary: probably he got that number by rule of thumb or trial and error until he got the desired number of compact categories.


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.