Why do we need to convert categorical variables into factor? Which functions are used to perform the conversion?
Answer Posted / Prashantpal
Converting categorical variables into factors (also known as dummy coding or one-hot encoding) is necessary in machine learning because computers can't understand categorical data directly. Instead, they treat each category as a unique number. R language provides functions like factor(), as.factor(), and recode() to convert categorical data into factors.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers