Skip to content

Glossary: ML Basics

One-hot encoding

Also written: OneHotEncoder, one-hot encode, handle_unknown, handle_unknown="ignore"

Turns a category column into one 0/1 column per category, so "plan" becomes plan_weekly, plan_biweekly and plan_monthly without implying an order. With handle_unknown="ignore", a category never seen in training becomes all zeros instead of an error.

Where the book teaches it

Related terms

Sparse matrix