i'm writing a few convenience functions for exploring datasets. For that, I have to guess the type of data from the values. What I'm looking for are some good rules of thumb.
Some easy cases:
['spam', 'eggs']
is nominal, because the dataset contains strings.[true, false, false]
is nominal, too.[0, 1, 0, 0, 0, 1, 1]
is either nominal or ordinal.[0, 1, 4, 3, 1, 2, 2]
too, but it's probably ordinal. Many values, and they have numbers, but not too many.[0.2, 2, 1.6, 3]
is cardinal, as the level of precision suggests there could possibly be many other values.
As you see the judgment is absolutely vague, but that's not the point: I just need heuristics that work in 80% of the cases. Or better, 95%. More ideas?