When you upload the generation or consumption data to a site, a set of preconfigured machine learning (ML) models is created. To start the training procedure of these models, you will need to provide a number of training parameters. Currently the following parameters are supported.

Site IDs site_ids
Specify a list of site IDs for which ML models will be trained.
Example: ["8fa9ef1d-4s89-4waf-8g52-b1aww743by47"]

Training set splits splits
Specify the starting and ending dates for the training data set splits. The ML model is trained only on the specific periods. By making use of this parameter it is possible to exclude periods with low quality training data, e.g. curtailment or maintenance periods, outliers, etc.
If splits is omitted, then the whole training data set is used for training.

  • Starting period start_date
    Specify the starting timestamp.
    Example: "2022-01-01T00:00Z"

  • Ending period end_date
    Specify the ending timestamp.
    Example: "2022-12-31T23:00Z"

Train models
import requests

api_key = "Your API key" # Set your API key

payload = {
    "site_ids": ["8fa9ef1d-4s89-4waf-8g52-b1aww743by47"],
    "splits": [
        {
            "start_date": "2022-01-01T00:00Z",
			"end_date": "2022-12-31T23:00Z"
        },
        {
            "start_date": "2024-01-01T00:00Z",
			"end_date": "2024-06-30T23:00Z"
        }		
    ]
}

url = "https://api.rebase.energy/platform/v2/sites/models/train"
headers = {"Authorization": api_key, "Content-Type": "application/json"}			

response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()

The response message informs that the training process has started. This can take some time depending on the number of the sites, and the size of the training sets.

Response example
{
    "message": "Training started"
}