cancel
Showing results for 
Search instead for 
Did you mean: 

Error when creating a Datetime Partitioning Spec in REST API

cpg
Image Sensor

Error when creating a Datetime Partitioning Spec in REST API

Hello all,

 

I have been able to successfully run a time series model through the python API with relative ease:

 

partitioning_spec = dr.DatetimePartitioningSpecification(
'DT', use_time_series=True, multiseries_id_columns=['Source'])
project.set_target('Value', partitioning_method=partitioning_spec)
 
---
 
I have not, however, had the same success using the same data and the same techniques (at least as far as I can tell) using the REST API:
 
{"useTimeSeries", true,
"datetimePartitionColumn", "DT",
"multiseriesIdColumns", ["Source"]}
 
I encounter the following error, which I can't find discussed online and cannot wrap my head around what it could be trying to tell me:
 

error{"message": "Column DT has not been analyzed for time series modeling with the specified multiseries id columns ['Source']."}

 

---

 

For reference, my test data looks like this:

DT                     Source   Value

01-01-2000      f1            1

01-01-2000      f2            100

01-02-2000      f1            2

01-02-2000      f2            105

...

 
Labels (1)
0 Kudos
10 Replies

You should add a step in order to wait for 200 code. Because time partitioning could take some time, if you send the command before it is completed it produces error. Check the code below.  Each STP must be applied separate steps in REST API.

STP

multiseries(POST)

BODY-Json

{
"datetimePartitionColumn": "PERIOD",
"multiseriesIdColumns": ["SERIAL_ID"]
}

STP
getresponse(GET)
BODY
{
"datetimePartitionColumn": "PERIOD",
"multiseriesIdColumns": ["SERIAL_ID"]
}
TEST

{
var project_id = pm.variables.get("projectId");
var res = JSON.parse(responseBody);
if (pm.response.code === 200){


detectedMultiseriesIdColumns = res.detectedMultiseriesIdColumns.length;


if (detectedMultiseriesIdColumns =="1" ) {
postman.setNextRequest("run");
console.log("OK");
}
else{
console.log(detectedMultiseriesIdColumns.length);
setTimeout(function(){},[20000]);
postman.setNextRequest("multiseries");
}

}
else{
setTimeout(function(){},[20000]);
postman.setNextRequest("getresponse");
console.log("getrestrepeat");
}


STP

run (PATCH)

BODY

{
"target": "TARGET",
"mode": "quick",
"featureDerivationWindowStart": -6,
"featureDerivationWindowEnd": 0,
"forecastWindowStart": 1,
"forecastWindowEnd": 3,
"numberOfBacktests": 2,
"useTimeSeries": true,
"datetimePartitionColumn": "PERIOD",
"multiseriesIdColumns": [
"SERIAL_ID"
],
"cvMethod": "datetime",
"blendBestModels": false,
"windowsBasisUnit": "MONTH"
}

0 Kudos