Passing in expected input_data to endpoint returns ForecastingDataException

Sunand Sandurkar 25 Reputation points
2024-03-07T10:54:46.71+00:00

I created an online endpoint for a model trained by AutoML (so the score python file was internally built by AutoML). When I pass a JSON input to the endpoint with the same parameters as the column names in the training CSV file, I get this error. What am I doing wrong?

azureml.automl.core.shared.forecasting_exception.ForecastingDataException: ForecastingDataException:
	Message: Argument [data] is of unsupported type: [<class 'dict'>]. Supported type(s): [pandas.DataFrame]
	InnerException: None
	ErrorResponse 
{
    "error": {
        "code": "UserError",
        "message": "Argument [data] is of unsupported type: [<class 'dict'>]. Supported type(s): [pandas.DataFrame]",
        "details_uri": "https://aka.ms/AutoMLConfig",
        "target": "data",
        "inner_error": {
            "code": "BadArgument",
            "inner_error": {
                "code": "ArgumentInvalid"
            }
        },
        "reference_code": "ac316505-87e4-4877-a855-7532473a796c"
    }
}
{"input_data":{"Date":"2024-04-02", "P1":935.5, "P2":65, "P3":45, "P4":38, "P5":51, "P6":17, "P7":38}}
Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,045 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,003 questions
0 comments No comments
{count} votes

Accepted answer
  1. dupammi 8,540 Reputation points Microsoft Vendor
    2024-03-07T13:17:13.4466667+00:00

    Hi @Sunand Sandurkar

    Thank you for using the Microsoft Q&A forum.

    Based on the error message, it seems that you are trying to pass a dictionary object as input to your endpoint, which is not supported as the endpoint seems to expect a pandas DataFrame object as input and not a dictionary object, by its sheer design.

    For your use case you convert the input dictionary to a pandas DataFrame object and then Pass the DataFrame object as input to the endpoint.

    For more details, please refer.

    I hope you understand. Thank you.


    Please do not forget to click Accept Answer and Yes for was this answer helpful, wherever the information provided helps you. This can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.