About Continuous Forecasts¶
After downloading the raw measurements data, forecasters can now prepare and submit Continuous Forecasts that are not tied in advance to any market session. Predico will automatically slice the series into the appropriate sessions and apply your latest values to each one.
This feature is designed to simplify the forecasting process and provide more flexibility for forecasters. By allowing you to submit a single forecast that covers multiple sessions, you can focus on improving your forecasting models without worrying about session boundaries, which also moves us closer to full intraday forecasting.
Note
The existing session-specific API endpoint will remain available, so current integrations will continue to work. If you prefer to keep submitting separate forecasts per session, you may do so.
How does it work?¶
The continuous forecast feature allows forecasters to submit a single forecast that covers multiple sessions. This means you no longer need to worry about the session boundaries when submitting your forecasts. However, there are still some guidelines to follow:
- Data Format: The forecast data should be in JSON format (same as before).
- Time Series: Include timestamps for each forecast value. There cannot be any gaps in the time series (between the first and last timestamp).
- Granularity: The forecast should be provided at quarter-hourly (15'') granularity.
- Time Range: The forecast horizon is flexible (up to 72 hours ahead) but must include at least the 24 hours of the day-ahead. This means you can provide forecasts for today, the next day and up to 72 hours ahead if you wish.
- Validation: The API will validate your data upon submission (HTTP 400). If the data is valid, it will be accepted and processed. The API will return a success message.
- Error Handling: If there are any errors in the submission, the API will return an error message detailing the issue.
- Session Slicing: Predico will automatically slice the series into the appropriate sessions and apply your latest values to each one. Note that you will need to submit a forecast for each variable (Q10, Q50, Q90) separately in order to be eligible for a market session (same as for the Session Forecast).
Below you can find an illustration of a potential continuous forecast, launched and submitted at 8h00 CET for the next hours. Note the mandatory period that will later be used by Predico's internal algorithms to create a Session Forecast , on your behalf.
Important
- You have the flexibility to submit multiple forecasts for the same time period. However, only the most recent forecast will be considered for market participation at sessions gate-closure.
- Upon gate-closure, a Session Forecast will be created on your behalf (by Predico), which you will also be able to query and inspect via the Listing Session Submissions endpoints.
Preparing a Continuous Forecast¶
Note
- Example Purpose: This example demonstrates preparing a 72-hour forecast submission with 15-minute interval samples using random data. Replace this with your forecasting model for actual use.
- Quantiles: The example submission includes values for three variables, specifically 'quantiles' 10, 50, and 90.
Prerequisites
- Python Environment: Ensure you have Python installed with the necessary libraries (
pandas
,numpy
,requests
). - Access Token: A valid access token is required for authentication. Refer to the Authentication section if needed.
Change this submission!
In this example, our submission will be exclusively composed by random samples.
However, you should prepare your model based on the raw measurements data for the challenge resource
(see
Downloading Raw Data section), and any external information sources you might have access to.
Start by retrieving our internal identifier for the target resource. You can use the resource name to retrieve this information from our API (later you can save this in local storage).
# Challenge resource name.
resource_name = "wind_farm_1"
# Get challenges target resource identifier (UUID)
# (this is also available via the /market/challenge/ endpoint )
response = requests.get(
url='https://predico-elia.inesctec.pt/api/v1/user/resource',
params={'resource_name': resource_name},
headers=headers
)
# Check if the request was successful
if response.status_code == 200:
resources = response.json()
else:
print("Failed to retrieve resource data.")
print(f"Status code: {response.status_code}")
exit()
# Get resource ID (UUID):
resource_id = resources["data"][0]["id"]
print("Resource ID:", resource_id)
Then, prepare your forecasts. In this example we will use synthetic data but you should use your own models to produce forecasts here. Note that you will need to create a payload per forecasted variable (i.e., q10
, q50
and q90
).
# Create a random 24h submission (random values):
# Generate datetime values for the challenge period:
start_datetime = dt.datetime.utcnow() + dt.timedelta(hours=1) # from 1h ahead from now
end_datetime = start_datetime + dt.timedelta(hours=71) # to 71h ahead
# Ensure we only work with quarter-hourly intervals
start_datetime = start_datetime.replace(minute=0, second=0, microsecond=0)
end_datetime = end_datetime.replace(minute=0, second=0, microsecond=0)
# Generate a range of datetime values with 15-minute intervals
datetime_range = pd.date_range(start=start_datetime,
end=end_datetime,
freq='15T')
datetime_range = [x.strftime("%Y-%m-%dT%H:%M:%SZ") for x in datetime_range]
# Generate random values for the "value" column
values = np.random.uniform(low=0.0, high=1.0, size=len(datetime_range))
values = [round(x, 3) for x in values]
# Reuse this data to prepare 3 different quantiles submissions Q10, Q50, Q90
submission_list = []
for qt in ["q50", "q10", "q90"]:
qt_forec = pd.DataFrame({
'datetime': datetime_range,
'value': values,
})
submission_list.append({
"variable": qt,
"forecasts": qt_forec.to_dict(orient="records")
})
# Your submissions:
print("Submission List:")
for i, submission in enumerate(submission_list):
print("-"*79)
print(f"Submission #{i+1}")
print(json.dumps(submission, indent=3))
What's next?¶
Learn how to submit your continuous forecasts on the Predico platform in the Submitting a Continuous Forecast section.