微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

数据输入期间的 Azure ML 时间序列模型推断错误 (python)

如何解决数据输入期间的 Azure ML 时间序列模型推断错误 (python)

在 Azure ML Studio 中,我使用 AutoML 准备了一个用于时间序列预测的模型。数据在所有数据集中都有一些罕见的差距。 我正在使用以下代码调用已部署的 Azure AutoML 模型作为 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],['2020-10-04 19:45:00',1.29294,['2020-10-04 21:00:00',1.29217,1.29163,34],['2020-10-04 21:15:00',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'

我非常感谢任何帮助,因为我被困在这里

解决方法

为避免在时间序列预测中出现提供的错误,您应该为预测范围启用自动检测。这意味着只有理想的时间序列数据才能使用手动设置的功能,这对现实世界的案例没有帮助。 see the image

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。