Skip to content

    One-Hot Encoding

    AI fundamentals & modelsIndicator encoding
    Reading time: 2 min.Editorially reviewed on:

    Definition

    One-hot encoding marks a category by exactly one set position.

    The representation of a categorical attribute as a vector in which exactly one position is one and the others are zero.

    Simply explained

    For red, green, and blue there are three boxes; only the matching one gets a one.

    Why it matters in practice

    Helps realistically assess model quality, limits, and technical decisions.

    Example from business

    The categories red, green, and blue are mapped onto three binary columns.

    Limits and pitfalls

    • Turning high cardinality into very wide features, not handling unknown categories, or creating unnecessary redundancy in linear models.

    Origin & history

    Indicator variables are a fundamental encoding method in statistics and machine learning.

    Use in mid-sized companies

    • Possible example: The categories red, green, and blue are mapped onto three binary columns.

    Frequently asked questions

    What does one-hot encoding mean?

    The representation of a categorical attribute as a vector in which exactly one position is one and the others are zero.

    Which mistakes should be avoided?

    Turning high cardinality into very wide features, not handling unknown categories, or creating unnecessary redundancy in linear models.

    Sources

    Source checked on 10.10.2026. Editorial application examples are hypothetical; no evidence of real customer results.

    Editorially reviewed on:

    On this page

    Next step

    Put knowledge into practice