Represent holidays during Random forest model training I am working on a supply chain problem where given a set of features, model has to predict how long will it take for a shipment to reach customer.
It is reasonable to assume that order will reach a customer within 20 days.
Target variable will be [0,1,2,...,19,20]. 0 would be mean same day delivery, 1 would mean next day delivery and so on.
I want to add supply chain vendor holidays as feature input to model. How should i represent them when inputting the model?
i am considering adding 20 more binary encoded columns:
holiday_0,holiday_1,......,holiday_19,holiday_20.
Is the above representation fine? Will model correlate the if holiday_2 is 1, then chances of order getting delivered on day2 are 0? Is there a better representation?
Edit:
An alternative representation I could think of is add a new feature called holidays which is 21 bit binary number translated to natural number.
Eg: holidays=0 if holiday_0 to holiday_20 are 0's
holidays=4  if holiday_2 =1 and other holiday_i are 0's where i!=2
 A: You could proceed as follows:

*

*Change training input: Say, a shipment took 3 days to deliver and day 2 was a holiday. You could change the target variable in your training set from 3 to 2 (and similar for all other cases).


*You fit the model without having to think about holidays.


*Adjust predictions: When your predictions are produced you adjust them by adding back holidays: If the predicted delivery time is 5 days and there is a holiday on day 2 and 4 you change the prediction from 5 to 7.
This eliminates the need for feature engineering. Of course, this assumes holidays have no other effects on the delivery time (which I think is reasonable).
A: Such data must first be converted into numerical input, and you can do this in two ways:
Given n categorical levels, create a new feature taking values 0,1,…,n−1
.  This method has the disadvantage of enforcing artificial relationships between the levels.
Given n categorical levels, create n-1 or n dummy variables, each one being a binary indicator of one of the levels.  This eliminates the drawback of imposing relationships between the categorical levels, but is also dilutes the strength of the feature.  A RF at each split point looks for the most predictive feature, but if you've changed a column into 5 or 10 of them, the power of each new dummy column individually is diminished, so perhaps the original feature never gets to speak.
Well try with the above said methods and build model.If the model is too much to predict consider making two variables one for normal days and one for holidays.
