Search code examples
data-sciencedata-analysisone-hot-encodingdata-preprocessing

Should I use both OneHotEncoder and OrdinalEncoder in one dataset?


if a dataset contains both nominal and ordinal columns, is the dataset need different encoders like OneHotEncoder for nominal and OrdinalEncoder for ordinal values?


Solution

  • Yes, categorical/nominal and numeric (including ordinal) variables need to be treated differently, and it is very.common to encounter datasets with several types of variables.