# What is One-Hot Encoding? Definition & Technical Mechanics

> **Source:** [SPIDITS AI AI Glossary](https://spidits.com/ai-glossary)  
> **Category:** Mathematical Foundations  
> **Canonical Citation:** [https://spidits.com/ai-glossary/one-hot-encoding](https://spidits.com/ai-glossary/one-hot-encoding)

## Definition
One-Hot Encoding is a data preprocessing technique that converts categorical variables (like "dog", "cat") into binary vector representations where only a single element is 1 (hot) and the rest are 0.

## Architectural Mechanics & Deep Dive
One-hot encoding is a data pre-processing technique used to represent categorical variables as binary vectors. A vector is created with a length equal to the number of unique categories; all elements are set to 0, except for the index of the active category, which is set to 1. This prevents machine learning models from assuming an incorrect ordinal ranking between independent categories.

## Industry Applications & Real-World Use Cases
Feature engineering, input vector structuring, and tabular ML training data prep

## Frequently Asked Questions

### Why use one-hot encoding?
Machine learning algorithms operate on numerical values. Converting words or categories to binary vectors allows them to process the data without implying a numerical ranking.

### What is the curse of dimensionality in one-hot encoding?
If a category has thousands of unique values (e.g. city names), one-hot encoding creates massive, sparse vectors, wasting RAM.

## Related Terminology
- [embedding](https://spidits.com/ai-glossary/embedding)
- [dimensionality-reduction](https://spidits.com/ai-glossary/dimensionality-reduction)

---
*From the SPIDITS AI Knowledge Base (336+ terms indexed). Explore full technical definitions: [https://spidits.com/ai-glossary](https://spidits.com/ai-glossary)*
