Listing your submission forecast skill scores¶
This section provides an example of how to list your submissions contributions to the final ensemble forecasts.
API Endpoints:¶
To interact with the Predicto API and retrieve information about your submission contributions to the final ensemble forecasts, you can use the following endpoints:
- GET
/api/v1/market/challenge/submission
- Retrieve a list of your previous submissions (and respective challenges). - GET
/api/v1/market/challenge/ensemble-weights
- Retrieve a list of your submissions scores and relative ranking to other forecasters.
Access Token Required
An access token must be included in the Authorization
header of your request. If you haven't obtained an access token yet, please refer to the Authentication section.
Check this out
Check our Useful Links section for additional resources (Jupyter Notebook, API Specifications) to help you get started with the Predico platform.
Retrieving your historical submissions:¶
Here's how you can retrieve the list your past submissions.
# List your historical submissions:
response = requests.get(
url='https://predico-elia.inesctec.pt/api/v1/market/challenge/submission',
headers=headers
)
# Check if the request was successful
if response.status_code == 200:
submissions = response.json()
else:
print("Failed to retrieve submissions.")
print(f"Status code: {response.status_code}")
exit()
For each submission, you can then retrieve the forecast skill scores:¶
# Select a submission and respective challenge:
selected_submission = submissions["data"][0]
submission_id = selected_submission['id']
challenge_id = selected_submission['market_session_challenge']
print("Selected Submission:")
print(f"Submission ID: {submission_id}")
print(f"Challenge ID: {challenge_id}")
# Request the submission contributions (weights) for the selected challenge
response = requests.get(
url='https://predico-elia.inesctec.pt/api/v1/market/challenge/ensemble-weights',
params={'challenge': challenge_id},
headers=headers
)
# Check if the request was successful
if response.status_code == 200:
submission_contributions = response.json()
print(submission_contributions)
else:
print("Failed to retrieve submission contributions.")
print(f"Status code: {response.status_code}")
exit()
JSON Example Response¶
After running the example script, you will have access your submissions contributions to the final ensemble forecasts.
Note that you will only have access to submission contributions once the evaluation phase of the challenge has been completed (which depends on the measurements data availability for the challenge period).
If you are not seeing any data during some days, please confirm if you are requesting data for the right challenge identifier.
Click to view Example Response
{
"code": 200,
"data": [
{
"ensemble": "ac63fe9a-302c-45a1-bbe6-812b85f48dc2",
"variable": "q10",
"rank": 1,
"total_participants": 3
},
{
"ensemble": "87380061-cefe-4bc4-9aaa-87d9304dd342",
"variable": "q90",
"rank": 1,
"total_participants": 3
},
{
"ensemble": "96afa99b-adbe-41ec-8a6c-16c092367520",
"variable": "q50",
"rank": 1,
"total_participants": 3
}
]
}