Closed tangyudi closed 5 years ago
Thank you very much for sharing,can you explain the purpose of this step!
week_period = 7 / (2 * np.pi) dow_norm = features_days.dayofweek.values / week_period dow = np.stack([np.cos(dow_norm), np.sin(dow_norm)], axis=-1)
Not OP, but the purpose is to turn day of week into a cyclical feature, which is common with many time-based features.
@roerwod , thanks for explanation!
Thank you very much for sharing,can you explain the purpose of this step!
week_period = 7 / (2 * np.pi) dow_norm = features_days.dayofweek.values / week_period dow = np.stack([np.cos(dow_norm), np.sin(dow_norm)], axis=-1)