TGViewer
Data science/ML/AI Data science/ML/AI @datascience_bds · 14K subscribers
Post #1329 1.24K
🧩 Why One-Hot Encoding Exists

Machine learning models don't understand words.
They understand numbers.

So how do you feed a value like:
Color = Red


You can't simply write:
Red = 1
Blue = 2
Green = 3


The model might think Green > Blue > Red, even though colors have no natural order.

Instead, we create separate columns:
Red    1 0 0
Blue 0 1 0
Green 0 0 1

This is called One-Hot Encoding. It represents categories without introducing fake relationships.
  • ❤ 8
More from @datascience_bds
  1. Oct 9, 20268 RAG architectures for AI Engineers, visually explained:
  2. Oct 8, 2026document post
  3. Oct 7, 2026🧮 NumPy: Why axis=0 and axis=1 Feel Backwards You've probably seen: np.mean(X, axis=0) an…
  4. Oct 6, 2026document post
  5. Oct 5, 2026📊 Pandas Cheatsheet Every Data Analyst Should Save Pandas is one of the most important to…
  6. Oct 4, 2026SQLBolt: Interactive SQL You can learn SQL by writing real queries directly in the browser…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →