📞 0339-0387701 (WhatsApp) Contact

« Back to Data Science & AI (NCCIA)

What is one-hot encoding used for?

A. Converting numbers into text
B. Converting a categorical variable into binary columns, one per category ✅
C. Reducing the number of rows
D. Encrypting the data

Correct Answer: B. Converting a categorical variable into binary columns, one per category

Explanation

One-hot encoding turns a category such as red, green or blue into separate 0/1 columns so models can use it numerically.