1ofN
1ofN, also known as one-of-N encoding or one-hot encoding, is a way of representing categorical variables as vectors in which exactly one of the N elements is active. In the standard form, the active element is set to 1 and all other elements are 0, producing a sparse, orthogonal code for each category. The concept is widely used in data processing, information encoding, and machine learning to convert nominal categories into numerical form suitable for algorithms.
In supervised learning, a common use is to encode the target variable when there are N classes.
Advantages of 1ofN encoding include its simplicity, interpretability, and ease of use with linear models and
See also: one-hot encoding, categorical variable encoding, embeddings, softmax.