Skip to content

Instantly share code, notes, and snippets.

@guyernest
Created May 18, 2019 15:36
Show Gist options
  • Select an option

  • Save guyernest/fb03185bb9ff3d25951bc0fcaac5d8ac to your computer and use it in GitHub Desktop.

Select an option

Save guyernest/fb03185bb9ff3d25951bc0fcaac5d8ac to your computer and use it in GitHub Desktop.
Forecast Pipeline 06
# Request for a forecast based on time and product filter
forecastResponse = forecastquery.get_forecast(
PredictorName=predictorName,
StartDate='2018-01-01T00:00:00Z',
EndDate='2018-01-10T00:00:00Z',
Interval="day",
Filters={"item_id":"012"}
)
# Creating a dataframe for the prediction output
predictions = forecastResponse['Forecast']['Predictions']
pd.concat({k: pd.DataFrame(v).T for k, v in predictions.items()}, axis=0).T
forecastId = forecastResponse['Forecast']['ForecastId']
forecast.create_forecast_export_job(
ForecastId= forecastId,
OutputPath = {
"S3Uri":"s3://forecast-xxxxxx/output/"+project+"/",
"RoleArn":roleArn
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment