Skip to main content
Skip table of contents

tw.endpoints.forecast.predict

tw.endpoints.forecast.predict(configuration=dict,dataset=pandas.DataFrame,model=dict)

Submit a predict job.
POST ``/forecast/predict``

Parameters

configuration : dict

Prediction configuration payload.

dataset : pandas.DataFrame

Data covering the prediction horizon.

model: dict

A trained forecast model.

Returns

dict

API response containing at least ``"id"`` (the new job identifier).

Example Configuration

CODE
forecast_predict_configuration = {
    'prediction_from': {
        'base_unit': 'sample',
        'value': 1
        },
    'prediction_to': {
        'base_unit': 'sample',
        'value': 1
    }, 
    'prediction_boundaries': {
        'type': 'explicit',
        'max_value': 100,
        'min_value': 0
    },
    'data_alignment': [
        {
            'column_name': 'string',
            'timestamp': 'yyyy-mm-dd hh:mm:ssZ'
        }
    ],
}

Example Usage

CODE
forecast_predict_response = tw.endpoints.forecast.predict(
    configuration = forecast_predict_configuration,
    dataset = dataset,
    model = model
)

Example Output

CODE
forecast_predict_id = forecast_predict_response['id']
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.