簡體   English   中英

Azure ML 時間序列 model 數據輸入期間的推理錯誤(python)

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

在 Azure ML Studio 中,我准備了一個帶有 AutoML 的 model 用於時間序列預測。 這些數據在所有數據集中都有一些罕見的差距。 我正在使用以下代碼調用已部署的 Azure AutoML model 作為 web 服務:

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)

我收到一個錯誤:

{\"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

我嘗試將“ignore_data_errors = True”添加到代碼的不同部分但沒有成功,因此出現另一個錯誤:

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

我非常感謝任何幫助,因為我陷入了困境。

為避免在時間序列預測中出現提供的錯誤,您應該為預測范圍啟用自動檢測。 這意味着只有理想的時間序列數據才能使用手動設置的功能,這對實際情況沒有幫助。 看圖片

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM