I am using XGbregressor on a dataset with many categorical features. A example looks like this:
shop_name Category Sub-category sub-sub-category revenue
Eateries Resturants Sushi
Eateries Resturants Italian
Eateries Fast-food Burger
Eateries Fast-food Burger
Fashion Luxury Jewelery
A)
shop_name Category Sub-category sub-sub-category revenue
1 1 1
1 1 2
1 2 1
1 2 1
2 1 1
B)
shop_name Category Sub-category sub-sub-category revenue
1 1 1
1 1 2
1 2 3
1 2 3
2 3 4
If I just label encode all these features, will Xgboost be able to make out the link between features? And which is a better way to do it, A or B?