Encoding colors without inventing an order
One-hot encoding creates indicator columns so a linear model can assign separate category effects.
OneHotEncoder in practice
Think of red, green and blue as three lamps, one lit per observation. Configure how the encoder handles an unseen color before deployment.
中文
独热编码怎样表达没有顺序的颜色?
独热编码为类别建立指示列,让线性模型可以给每种类别单独的系数。
OneHotEncoder 应用实例
把红、绿、蓝映成三盏指示灯,每行只亮一盏。线上遇到未见颜色时,忽略或报错取决于编码器的显式设置。