and hour of day features this transformation finally yields model that performs similarly well to the random forest big benefit of this model is that it is very clear what is learnedone coefficient for each day and time we can simply plot the coefficients learned by the modelsomething that would not be possible for the random forest firstwe create feature names for the hour and day featuresin[ ]hour ["% : for in range( )day ["mon""tue""wed""thu""fri""sat""sun"features day hour then we name all the interaction features extracted by polynomialfeaturesusing the get_feature_names methodand keep only the features with nonzero coefficientsin[ ]features_poly poly_transformer get_feature_names(featuresfeatures_nonzero np array(features_poly)[lr coef_ ! coef_nonzero lr coef_[lr coef_ ! now we can visualize the coefficients learned by the linear modelas seen in figure - in[ ]plt figure(figsize=( )plt plot(coef_nonzero' 'plt xticks(np arange(len(coef_nonzero))features_nonzerorotation= plt xlabel("feature magnitude"plt ylabel("feature"utilizing expert knowledge