In the famous book "The Elements of Statistical Learning" by Hastie et al., the authors denoted unordered categorical variables as qualitative variables / nominal variables / factors.

I wonder, do other statisticians strictly follow this or some authors can use these terms (qualitative variables / nominal variables / factors) not only for unordered categorical variables but also for ordered categorical variables?

  • $\begingroup$ Is there any difference? Eventually you'll one-hot encode it, so it won't matter. $\endgroup$ Commented Nov 18, 2019 at 19:21
  • $\begingroup$ I think there is difference. For example, label encoding for ordered categorical variable will usually give much better results than one-hot for tree-based methods because it will save internal order of variable. Next, in clustering task Murphy in his book (Machine Learning a probabilistic perspective) writes: "For ordinal variables, such as {low, medium, high}, it is standard to encode the values as real-valued numbers, say 1/3, 2/3, 3/3 if there are 3 possible values. One can then apply any dissimilarity function for quantitative variables, such as squared distance." $\endgroup$
    – Rodvi
    Commented Nov 18, 2019 at 19:30
  • $\begingroup$ I would strongly discourage vanilla label encoding, particularly when everyone's doing DNN. You can't value some variable values over the others. How would your metric distance benefit from label encoding anyway? Let's say you have: apple(0), pear(1), strawbeery(2), peanut(3). You want to tell me i can calculate distance from pear to apple, based on some arbitrary mapping? Isn't that nonsense? Each value is different without actual metric itself. If you want any meaningful distance you'll need One Hot anyway, which is just multiplication over sets. $\endgroup$ Commented Nov 18, 2019 at 19:39
  • 1
    $\begingroup$ @Rodvi is not talking about fruits, which do not form ordered categories so there is no reason to encode them that way. But there exists ordinal categorical data. It's not the same thing. $\endgroup$
    – serali
    Commented Nov 18, 2019 at 20:09

1 Answer 1


The statistical programming language R uses the term "ordered factor," so factor isn't completely safe, though I can't find an example of an ordinal variable being called "factor" without the adjective.

I think ordinal variables are fairly often considered either qualitative or quantitative: they have the quantitative feel from the ordering, but lack mathematical operations. See the end of this post for a few examples.

But "nominal" seems relatively safe as meaning only unordered. (I found one contradiction to this, the Bonus Note #2 at https://www.mymarketresearchmethods.com/types-of-data-nominal-ordinal-interval-ratio/, but that's immediately contradicted by having "ordinal" in the next section?)

See also https://en.wikipedia.org/wiki/Level_of_measurement, especially the "Debate" section that lists a few other proposals. (Chrisman's proposal is nice for including "cyclic" features that are sometimes important in ML but don't fit into most standard libraries without some [unfaithful] encoding.)

A few links to show that the lines get blurred:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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