week and time of day it has an of and shows pretty good predictive performance what this model likely is learning is the mean number of rentals for each combination of weekday and time of day from the first days of august this actually does not require complex model like random forestso let' try with simpler modellinearregression (see figure - )in[ ]from sklearn linear_model import linearregression eval_on_features(x_hour_weekylinearregression()out[ ]test-set ^ figure - predictions made by linear regression using day of week and hour of day as features linearregression works much worseand the periodic pattern looks odd the reason for this is that we encoded day of week and time of day using integerswhich are interpreted as categorical variables thereforethe linear model can only learn linear function of the time of day--and it learned that later in the daythere are more rentals howeverthe patterns are much more complex than that we can capture this by interpreting the integers as categorical variablesby transforming them using one hotencoder (see figure - )in[ ]enc onehotencoder(x_hour_week_onehot enc fit_transform(x_hour_weektoarray(utilizing expert knowledge