@@ -98,27 +98,49 @@ def forecast(self, endpoint_id, records, forced_generation=None, dispatch_key=No
98
98
Forecast using a time series forecasting model on a DSS API node endpoint
99
99
100
100
:param str endpoint_id: Identifier of the endpoint to query
101
- :param records: List of time series data records to be used as an input for the
102
- time series forecasting model. Each record should be a dict where
103
- keys are feature names, and values feature values.
104
- Example: records = [
105
- {'date': '2015-01-04T00:00:00.000Z', 'timeseries_id': 'A', 'target': 10.0},
106
- {'date': '2015-01-04T00:00:00.000Z', 'timeseries_id': 'B', 'target': 4.5},
107
- {'date': '2015-01-05T00:00:00.000Z', 'timeseries_id': 'A', 'target': 2.0},
108
- ...,
109
- {'date': '2015-03-20T00:00:00.000Z', 'timeseries_id': 'B', 'target': 1.3}
110
- ]
101
+ :param array records: List of time series data records to be used as an input for the
102
+ time series forecasting model. Each record should be a dict where
103
+ keys are feature names, and values feature values.
104
+
105
+ Example:
106
+
107
+ .. code-block:: python
108
+
109
+ records = [
110
+ {'date': '2015-01-04T00:00:00.000Z',
111
+ 'timeseries_id': 'A', 'target': 10.0},
112
+ {'date': '2015-01-04T00:00:00.000Z',
113
+ 'timeseries_id': 'B', 'target': 4.5},
114
+ {'date': '2015-01-05T00:00:00.000Z',
115
+ 'timeseries_id': 'A', 'target': 2.0},
116
+ ...
117
+ {'date': '2015-03-20T00:00:00.000Z',
118
+ 'timeseries_id': 'B', 'target': 1.3}
119
+ ]
120
+
121
+
111
122
:param forced_generation: See documentation about multi-version prediction
112
123
:param dispatch_key: See documentation about multi-version prediction
113
124
114
125
:return: a Python dict of the API answer. The answer contains a "results" key
115
- (which is an array of result objects, corresponding to the forecast records)
116
- Example: {'results': [
117
- {'forecast': 12.57, 'ignored': False, 'quantiles': [0.0001, 0.5, 0.9999], 'quantilesValues': [3.0, 16.0, 16.0],
118
- 'time': '2015-03-21T00:00:00.000000Z', 'timeseriesIdentifier': {'timeseries_id': 'A'}},
119
- {'forecast': 15.57, 'ignored': False, 'quantiles': [0.0001, 0.5, 0.9999], 'quantilesValues': [3.0, 18.0, 19.0],
120
- 'time': '2015-03-21T00:00:00.000000Z', 'timeseriesIdentifier': {'timeseries_id': 'B'}},
121
- ...], ...}
126
+ (which is an array of result objects, corresponding to the forecast records)
127
+ Example:
128
+
129
+ .. code-block:: python
130
+
131
+ {'results': [
132
+ {'forecast': 12.57, 'ignored': False,
133
+ 'quantiles': [0.0001, 0.5, 0.9999],
134
+ 'quantilesValues': [3.0, 16.0, 16.0],
135
+ 'time': '2015-03-21T00:00:00.000000Z',
136
+ 'timeseriesIdentifier': {'timeseries_id': 'A'}},
137
+ {'forecast': 15.57, 'ignored': False,
138
+ 'quantiles': [0.0001, 0.5, 0.9999],
139
+ 'quantilesValues': [3.0, 18.0, 19.0],
140
+ 'time': '2015-03-21T00:00:00.000000Z',
141
+ 'timeseriesIdentifier': {'timeseries_id': 'B'}},
142
+ ...],
143
+ ...}
122
144
"""
123
145
124
146
obj = {"items" : records }
0 commit comments