What should be the format for input-data while Testing the endpoints of deployed Prophet Time-series model in Azure-ML?

SP 5 Reputation points
2023-03-23T04:00:37.8066667+00:00

I have trained and deployed a FbProphet Time-series model using Mlflow in the Azure-ML . The model was properly registered and logged with all the required entities. I was able to deploy the model in Azure-ML and generate the endpoints.

My training Dataframe (which i used for training the Prophet mode) looks like :


df =  pd.DataFrame({'ds': ['2023-01-01 00:00:00', '2023-01-01 01:00:00', '2023-01-01 02:00:00', '2023-01-01 03:00:00'],
            'y': [20, 21, 19, 18]})

Now I want to test those endpoints. Under the testing-section, I see error while trying to give input. The interface for taking input looks like :

{
  "input_data" : 
}

I am unable to figure out,

exactly what data (please provide example) and in which format should be entered here to test my time-series prophet model.?

P.S. - I know that for prediction prophet takes Dataframe (which contains dates in the column named as 'ds') as an input to predict the future values. But in the Azure-testing interface there is no provision to enter a Dataframe (or if there, i do not know how to do it).

Also even for utilizing the end-points in the code I need to know the type and format of input_data required for consumption of end-points.

I have tried many combinations and every time I am getting error.

for e.g.

  1. using json on the data

json.dumps({'data': df.to_dict(orient='records')})

and feeding the its output here as :

{
      "input_data":[{"ds": "2021-01-01 00:00:00", "y": 23.55}, {"ds": "2021-01-01 01:00:00", "y": 26.28}]
    }

Error - Failed to test real-time endpoint {"message":"only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices"}

2- trying other combinations

{
  "input_data" :{"ds":{"1":"2023-04-01 22:00:00", "2": "2023-04-01 23:00:00"}
}

Error: Failed to test real-time endpoint {"message":"POST body could not be decoded as JSON: Expecting ',' delimiter: line 3 column 2 (char 81)"}

3- feeding only dates

{
  "input_data" :["2023-04-01 22:00:00","2023-04-01 23:00:00"]
}

then

{

"input_data" :[[1,2], ["2023-04-01 22:00:00","2023-04-01 23:00:00"]]

}

Error : Failed to test real-time endpoint {"message":"only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices"}

And likewise, i tried many more ways. But not able to figure out my mistake. Please help me, what i am missing-out ? I am new to deploying a Time-Series model.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,559 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Shohei Nagata 0 Reputation points Microsoft Employee
    2023-05-16T01:30:23.9666667+00:00

    We need to authenticate to the online endpoint to open the Swagger URL.

    I know the following page doesn't show the exact way to get the Swagger but it can be helpful to understand the authentication.

    https://learn.microsoft.com/en-us/azure/machine-learning/how-to-authenticate-online-endpoint?view=azureml-api-2&tabs=azure-cli

    Also, using the AzureML inference HTTP server locally will help us understand the behavior of the server used in online endpoints.
    https://learn.microsoft.com/en-us/azure/machine-learning/how-to-inference-server-http?view=azureml-api-2