# how to decide categorical variables for prediction

I have a dataset that contains weekly sales for stores and categories. It looks like this:

I would like to apply gradient boosting method to predict weekly sales. My question is: Should I create dummy variables for categories(1 to 7 which indicates product type) and stores(1 to 11)?

• What are categories in here? – David Masip May 23 '18 at 13:41

It would not make any sense to have a leaf splitting your data on a criterion such as $Store >= 5$. However, it would make sense to have a separator such as $Store_5 = 1$ (vs $Store_5 = 0$). This is precisely why dummy variables are created for categorical values in ensemble methods, such as gradient boosting.