A
AcadiFi
EN
EncoderElla2026-03-24
cfaLevel IIQuantitative MethodsRegression

What are the main ways to encode categorical variables for regression and when should I use each?

Beyond standard dummy coding I keep seeing mentions of effect coding, target encoding, and one-hot. How do I choose?

96 upvotes
AcadiFi TeamVerified Expert
AcadiFi Certified Professional
The right encoding depends on the model type and what you want the coefficients to mean. Four common choices: reference coding, effect coding, one-hot, and target encoding.

Unlock with Scholar — $19/month

Get full access to all Q&A answers, practice question explanations, and progress tracking.

No credit card required for free trial

📊

Master Level II with our CFA Course

107 lessons · 200+ hours· Expert instruction

#encoding#categorical#machine-learning