MLOps Glossary

Ordinal encoding

Ordinal encoding:

(aka label encoding) A technique for representing a categorical feature where each category is represented by an integer, e.g. for a feature “Sex” with categories “Male”, “Female”, we may represent “Male” with 0 and “Female” with 1. This may not be appropriate for many models which can rely on the ordering of numbers (i.e., you can’t order the categories “Male”, “Female” in a meaningful way, but using ordinal encoding you may inadvertently do so).