Skip to content

Instantly share code, notes, and snippets.

@cydal
Created November 26, 2020 15:40
Show Gist options
  • Save cydal/3740a62053fbd7c1db3c247641a06126 to your computer and use it in GitHub Desktop.
Save cydal/3740a62053fbd7c1db3c247641a06126 to your computer and use it in GitHub Desktop.
## Build Features for forecasting
build_forecast_df = build_features_forecast(df.energy, features_request, include_tzero=True)
scaled_features_forecast = scaler_features.transform(build_forecast_df.tail(48))
pred = model.predict(scaled_features_forecast[:, :-1])
pred = scaler_label.inverse_transform(pred)
# Range for next 24 hours
range = pd.date_range(start=build_df.index[-1]+timedelta(minutes=30),
end=build_df.index[-1]+timedelta(hours=24),
freq="30T")
range.freq = None
range = range.to_list()
# Request
### Get actual values
new_data = pvl.between(pytz.utc.localize(range[0]), pytz.utc.localize(range[-1]))
new_data = np.array([x[2] for x in new_data])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment