Managing forecasts¶
A forecast is a set of predictions for combinations of units and targets. See Data Model for detail on the structure of predictions. Following are the forecast operations you can do from within Zoltar.
Note: Operations on forecasts, like many Zoltar activities, can be done either through the zoltardata.com web interface or programmatically using the Zoltar libraries.
Note: As mentioned in Concepts, forecasts can have versions via their
issued_at
field. However, versioning is currently supported only via the API.
Upload a forecast¶
Here we show how to upload forecast data into Zoltar.
Note: As mentioned at Jobs, uploading a forecast is done in a separate worker process because it may take more than a handful of seconds to run. Thus, the workflow is based on that (see Job workflow for details).
Forecasts are uploaded to a particular model for a particular time zero. To upload one:
- Go to the model detail page of the one you want to upload into.
- Make sure "Hide if no data" is unchecked.
- Find the time zero that the forecast is associated with.
- If the time zero already has a forecast then delete it (see Delete a forecast below). You can tell if a time zero has an uploaded forecast in two ways: the text in the "Data Source" column is a link instead of the words "(No data)" and the icon in the "Action" column is a red trash can and not a green upload icon.
- Click the "Browse..." button in the time zero's "Action" column.
- In the dialog that appears, select a Zoltar Forecast data file. The format can be either JSON or CSV.
- Click the green upload button.
- If the file is OK then you will be taken to a job detail page that shows the status of your upload, with the message "Queued the forecast file _ for uploading.", where _ is your file's name.
- Once the upload is successful (you can refresh the job detail page to check) then you will see the newly-uploaded file listed next to the selected time zero on the model detail page.
- If there was a problem uploading then you will see the upload's status as FAILED. The Failure section will provide some information to help debug the problem.
Delete a forecast¶
Delete a forecast via these steps:
- Go to the model detail page where the forecast resides.
- Click the red trash can button in the "Action" column.
- Click "Delete" in the confirmation dialog that appears. Note that this cannot be undone!
Download a single forecast¶
To download a particular forecast:
- Go to the model detail page where the forecast resides.
- Click the link in the "Data Source" column to go to the forecast detail page.
- Click the "Download JSON" button and save the file in the JSON format documented at Forecast data format for details.
(Note that if you are only interested in a particular unit/target combination, you can use the "Query Forecast Data" form on that page - see here for details.)
Download multiple forecasts¶
Note: Downloading multiple forecasts is currently available only to users with Zoltar accounts.
Note: As mentioned at Jobs, downloading a forecast is done in a separate worker process because it may take more than a handful of seconds to run. Thus, the workflow is based on that (see Job workflow for details).
Forecasts are downloaded by executing a forecast query by either a) Zoltar API using the Zoltar libraries, or b) via a simple web UI form (described next). In both cases you need to follow these steps:
- Decide the data of interest (i.e.,
models
,units
,targets
,timezeros
, and predictiontypes
). - Submit the query to get a Job ID.
- Poll the resulting Job until it succeeds (see Check a job's status).
- Download the job's data (see Download a job's data). The format is described at Forecast data format (CSV).
Download forecasts via the web UI¶
To download forecast data via the web UI:
- Go to the project detail page whose models contain the forecasts.
- Click the "Download" button to the right of "Forecasts" in the Features section at the page's top.
- On the "Edit Forecast Query" page that shows, enter your query and then click "Submit" (see the screenshot below).
- Poll the resulting Job until it succeeds (see Check a job's status).
- Download the job's data (see Download a job's data). It is in Forecast data format (CSV).
Here's an example of the Edit Forecast Query page: