Amazon DeepAR是一种用于时间序列预测的深度学习模型,可以自动对多项超参数进行优化。但在调用超参数优化方法时,可能会出现以下错误提示:
"Error: 'TuningJobStatus' object has no attribute 'BestTrainingJob'"
这通常是由于没有在定义超参数时正确指定所需的参数值或格式错误。
为解决此问题,可以按照以下步骤进行操作:
hyperparameters = { "epochs": "50", "prediction_length": "24", "learning_rate": "0.01", }
tuner = HyperparameterTuner(estimator, hyperparameters, objective_metric_name, objective_type, max_jobs, max_parallel_jobs)
tuner.fit({'train': s3_input_train, 'test': s3_input_test})
objective_metric_name = 'mse' objective_type = 'Minimize'
s3_input_train = sagemaker.s3_input(s3_data=train_data, content_type='text/csv') s3_input_test = sagemaker.s3_input(s3_data=test_data, content_type='text/csv')
使用以上方法,可以正确设置Amazon DeepAR超参数,并避免出现调优错误。