Categorical preprocessing starts by naming the allowed tokens and the output columns.
Pin the category list first
The known color list is red, blue, green. The column order is pinned before any row is encoded.
categories=(red,blue,green)
Make explicit columns
The indicator columns are red, blue, green, and other. The other column is reserved for the stated unknown-category policy.
columns=(red,blue,green,other)
This is preprocessing
No model has been trained. Category tokens are only being rewritten into explicit indicator columns.
category token→indicator row