Skip to main content
Skip table of contents

tw.endpoints.forecast.build_model

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

Submit a model-building job.
POST ``/forecast/build-model``

Parameters

configuration : dict

Model configuration payload.

dataset : pandas.DataFrame

Historical training data serialised as CSV and sent as a multipart file.

Returns

dict

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

Example Configuration

CODE
forecast_build_model_configuration = {
    'target_column': 'string',
    'categorical_columns': [
        'string'
    ],
    'holiday_column': 'string',
    'prediction_from': {
        'base_unit': 'sample',
        'value': 1
    },
    'prediction_to': {
        'base_unit': 'sample',
        'value': 24
    },
    'target_offsets': 'combined',
    'predictor_offsets': 'common',
    'allow_offsets': True,
    'offset_limit': 0,
    'normalization': True,
    'max_feature_count': 20,
    'transformations': [
        'exponential_moving_average',
        'rest_of_week',
        'periodic',
        'intercept',
        'piecewise_linear',
        'time_offsets',
        'polynomial',
        'identity',
        'simple_moving_average',
        'month',
        'trend',
        'day_of_week',
        'fourier',
        'public_holidays',
        'one_hot_encoding'
    ],
    'daily_cycle': True,
    'confidence_level': 90,
    'data_alignment': [
        {
            'column_name': 'string',
            'timestamp': 'yyyy-mm-dd hh:mm:ssZ'
        }
    ]
}

Example Usage

CODE
forecast_build_model_response = tw.endpoints.forecast.build_model(
    configuration = forecast_build_model_configuration,
    dataset = dataset
)

Example Output

CODE
forecast_build_model_id = forecast_build_model_response['id']
JavaScript errors detected

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

If this problem persists, please contact our support.