FE
FeatureFred2026-03-24
cfaLevel IIQuantitative MethodsMachine Learning
What pitfalls should I watch out for with one-hot encoding?
I one-hot encoded every categorical variable in my dataset and my OLS regression now produces NaN coefficients. What went wrong?
84 upvotes
AcadiFi TeamVerified Expert
AcadiFi Certified ProfessionalThree common pitfalls with one-hot encoding: the dummy variable trap, curse of dimensionality, and train/test category mismatch.
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
#one-hot#multicollinearity#pitfalls
Related Questions
How do I map a CFA Ethics vignette to the right standard?
cfa·Level I·52 upvotes
When does a duty to clients override pressure from an employer?
cfa·Level I·47 upvotes
Do conflicts have to be disclosed before making a recommendation?
cfa·Level I·41 upvotes
Why do CFA Ethics answers focus so much on the action taken?
cfa·Level I·58 upvotes
What does a high-water mark actually do in a hedge fund fee calculation?
cfa·Level I·45 upvotes
Join the Discussion
Ask questions and get expert answers.