我正在使用 AI Platform 中的 GCP automl sdk 模块创建模型(使用 bigquery 表作为训练和预测的输入)并使用 batch_prediction 进行预测。问题是代码运行良好,但预测的输出表为空,并且错误表包含来自预测数据帧和添加列的所有系列,说明错误代码 3,错误是“时间序列没有要预测的值。时间序列已经排除在预测之外。”。
我用于模型训练的代码:
job = aiplatform.AutoMLForecastingTrainingJob(
display_name='train-sdk-automl_tst1',
optimization_objective='minimize-mae',
column_transformations=[
{"timestamp": {"column_name": "Date"}},
{"numeric": {"column_name": "Price"}},
{"numeric": {"column_name": "Grammage"}},
{"numeric": {"column_name": "apparentTemperatureMax"}},
{"numeric": {"column_name": "apparentTemperatureMin"}},
{"numeric": {"column_name": "Consumer_promo"}},
{"numeric": {"column_name": "Promo_Value"}},
{"numeric": {"column_name": "Trade_Promotion"}},
{"numeric": {"column_name": "Holiday"}},
{"numeric": {"column_name": "Sales"}},
]
)
# This will take around an hour to run
my_model = job.run(
dataset=ds,
target_column='Sales',
time_column='Date',
time_series_identifier_column='SKU',
available_at_forecast_columns=['Date', 'Price','Grammage'
,'apparentTemperatureMax','apparentTemperatureMin','Consumer_promo',
"Promo_Value","Trade_Promotion","Holiday"],
unavailable_at_forecast_columns=['Sales'],
forecast_horizon=21.0,
data_granularity_unit='week',
data_granularity_count=1,
weight_column=None,
budget_milli_node_hours=1000,
model_display_name='sdk_tsting_bq-forecast-model',
predefined_split_column_name=None
)
预测代码:
BATCH_PREDICT_SOURCE = 'bq://acn-intelligent-supply-chain.scoa_ml_forecast_tool.test_data_sdk1'
BATCH_PREDICT_DESTINATION_PREFIX = 'bq://acn-intelligent-supply-chain.scoa_ml_forecast_tool'
my_model.batch_predict(
bigquery_source=BATCH_PREDICT_SOURCE,
instances_format='bigquery',
bigquery_destination_prefix = BATCH_PREDICT_DESTINATION_PREFIX,
predictions_format='bigquery',
job_display_name='predict_sdk_tst')
请建议这里可能出了什么问题。