Understanding Nominal and Ordinal Data: Meaning, Differences, and Applications.

Sunny Kumar
2 min readNov 28, 2023

--

To deal with data, we have to understand the data.

ordinal and nominal

Let us look at a sample data to understand Ordinal and nominal data types.

temperature sample

Above data has has three columns, weather , temperature and location all three are categorical variables. Now, if we look at the column weather, it has three categories, sunny, rainy and windy. From mathematical perspective, we can’t say rainy will come before windy and there can’t be any mathematical operation possible between the values. like, we can have rainy + windy. This is what make “weather” column a nominal type. It simply means, there is no order between the variables.

Now, let us look at other column “temperature”, here there is a mathematical order between the elements of column like: hot>mild>cold. But possibility of mathematical operation between any two values is nil. we can not sum any two values and come up with new value. Although elements in temperature column have a defined order in way we can place it, there can’t be any mathematical operation between the two. This is what called as ordinal type.

In machine learning there are certain situation where we have to convert numbers to ordinal types. Let us look at an example how we can achieve it.

nominal data

In above data sample, we have two sample columns “temperature and type” . Temperature is number type . To convert number to ordinal data type we can define a range, like in this case we defined a range for temperatures, 1–10 -> low , 11–30-> medium and 31–45-> high. This range helped to convert number to ordinal data type. While developing ML models this conversion often aids us in managing model complexity.

Conclusion

In above article we looked at what is nominal and ordinal data type. we also looked at how we can convert mumbers to ordinal data type. I hope you liked the article. Happy reading. :)

--

--

Sunny Kumar

Loves technology . Combining AI and AR to create meaningful solutions.