Skip to content

Instantly share code, notes, and snippets.

@bkaankuguoglu
Created November 25, 2021 15:01
Show Gist options
  • Save bkaankuguoglu/f5546dc0a98acacdcecd560a012664b6 to your computer and use it in GitHub Desktop.
Save bkaankuguoglu/f5546dc0a98acacdcecd560a012664b6 to your computer and use it in GitHub Desktop.
df_forecast['value'] = 0
df_forecast= (df_forecast
.assign(hour = df_forecast.index.hour)
.assign(day = df_forecast.index.day)
.assign(month = df_forecast.index.month)
.assign(day_of_week = df_forecast.index.dayofweek)
.assign(week_of_year = df_forecast.index.week)
)
df_forecast = onehot_encode_pd(df_forecast, ['month','day','day_of_week','week_of_year'])
df_forecast = generate_cyclical_features(df_forecast, 'hour', 24, 0)
df_forecast = add_holiday_col(df_forecast, us_holidays)
df_forecast[list(set(X_train.columns)-set(df_forecast.columns))] = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment