question

AlexeyPisakov-8757 avatar image
0 Votes"
AlexeyPisakov-8757 asked AlexeyPisakov-8757 edited

Azure ML time series model inference error during data input (python)

I prepared a model for time series forecasting. The data have some rare gaps in all data sets. I am using the following code to call for a deployed Azure AutoML model as a web service:

 import requests
 import json
 import pandas as pd
    
 # URL for the web service
 scoring_uri = 'http://xxxxxx-xxxxxx-xxxxx-xxxx.xxxxx.azurecontainer.io/score'
        
 # Two sets of data to score, so we get two results back
 new_data = pd.DataFrame([
             ['2020-10-04 19:30:00',1.29281,1.29334,1.29334,1.29334,1],
             ['2020-10-04 19:45:00',1.29334,1.29294,1.29294,1.29294,1],
             ['2020-10-04 21:00:00',1.29294,1.29217,1.29334,1.29163,34],
             ['2020-10-04 21:15:00',1.29217,1.29257,1.29301,1.29115,195]],
             columns=['1','2','3','4','5','6']        
 )
 # Convert to JSON string
 input_data = json.dumps({'data': new_data.to_dict(orient='records')})
    
 # Set the content type
 headers = {'Content-Type': 'application/json'}
        
 # Make the request and display the response
 resp = requests.post(scoring_uri, input_data, headers=headers)
 print(resp.text)

I am getting an error:

 {\"error\": \"DataException:\\n\\tMessage: No y values were provided. We expected non-null target values as prediction context because there is a gap between train and test and the forecaster depends on previous values of target. If it is expected, please run forecast() with ignore_data_errors=True. In this case the values in the gap will be imputed.\\n\\tInnerException: None\\n\\tErrorResponse \\n{\\n

I tried to add "ignore_data_errors=True" to different parts of the code without a success, hence, getting another error:

 TypeError: __init__() got an unexpected keyword argument 'ignore_data_errors'

I would very much appreciate any help as I am stuck at this.


azure-machine-learningazure-machine-learning-inference
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AlexeyPisakov-8757 With respect to the error with ignore_data_errors argument it needs to be supplied with your model after you retrieve the best model.

 fitted_model.forecast(x, y, ignore_data_errors=True)

The usage of this is partially mentioned in this notebook but with the argument, you can try to use the model retrieved and deployed after this run.


0 Votes 0 ·

@romungi-MSFT
Thank you for your answer but I am using the Azure ML Studio and from there I just click "Deploy" for the right model after the AutoML run and get a ready to use Endpoint. I didn't find a way to apply the recommented parameter during or after the deployment in the Studio. Should/can I apply the parameter during running an experiment? Or maybe I should change any files of the model?
Thank you.

0 Votes 0 ·

@AlexeyPisakov-8757 If you are using the studio directly instead of the SDK then there are options to autodetect forecast horizon & target lags as seen in the additional configuration settings here.

54783-image.png

You can use featurization settings to further impute data to train and then deploy a new model after the run.


1 Vote 1 ·
image.png (125.7 KiB)
Show more comments

0 Answers