ordinal and label encoding
there are normally two types of data
1. ordinal data: those data which have any levels of dependencies i.e: for a degree column:
bachelor degree is higher than high school; degree and master is greater than bachelor
in such case we can level master as 3, Bachelor as 2 and high school as 1 and school as 0
it has rank
2. Nominal data: those data which doesn't have any level of dependencies
eg: car fuel type I.,e automatic and manual
gender: either male or female
they don't have any dependencies one is higher and another is lower
note: we use ordinal and label encoding for ordinal data
we use one hot encoding for Nominal data
ordinal encoding:
it is such type of encoding which is done if X column have ordinal categorical data ;
how it works:
generally assigning some numerical value according to their rank;see in eg
label encoding:
it is such type of encoding which is done if Y i.e target have categorical data
for ordinal and label encoding goto: untitled 8
Comments
Post a Comment