数据输入期间的 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

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...