![見出し画像](https://assets.st-note.com/production/uploads/images/171565322/rectangle_large_type_2_78d2c6cc9bbacbab85cc3762232c13d0.png?width=1200)
AutoGluonによる時系列予測
MOAI Labでは、最適化だけでなく、予測に対してもSOTAを複数準備し、問題に応じて(自動的に)使い分けることによって、SOTA以上のパフォーマンスをご提供しています。
予測手法についても、ベイズ推論、深層学習、自動機械学習のSOTAをベンチマークしていますが、ここではそのうちの1つであるAutoGluonの時系列予測についてご紹介します。
AutoGluonの時系列予測機能は、複数の時系列データに対して自動的に最適なモデルを構築し、確率的予測を生成することができます。以下に主要なモデルとその特徴をまとめます。
モデルの種類と特徴
![](https://assets.st-note.com/img/1737508822-tPAEh3Rc82DSWFrdnyKpk9Te.png?width=1200)
主要な特徴
確率的予測: 点予測だけでなく、予測値の分位数も提供し、不確実性の範囲を示すことができます[7]
プリセット設定:
fast_training: 高速な学習を重視
medium_quality: バランスの取れた学習
high_quality: 高精度な予測を重視
best_quality: 最高精度を追求[10]
自動最適化: モデル選択やハイパーパラメータのチューニングを自動的に行い、指定された時間内で最適なモデルを構築します[5]
この時系列予測システムは、ビジネス予測、需要予測、キャパシティプランニングなど、様々な実務的な予測タスクに活用できます[5]。
Citations:
[1] https://note.com/united_code/n/n5fb3c83521d3
[2] https://arxiv.org/abs/2308.05566
[3] https://aws.amazon.com/jp/blogs/news/tag/autogluon/
[4] https://www.cresco.co.jp/blog/entry/entry5293524353522381166.html
[5] https://aws.amazon.com/blogs/machine-learning/easy-and-accurate-forecasting-with-autogluon-timeseries/
[6] https://www.hinomaruc.com/try-autogluon-timeseries-forecasting-on-google-colab-gpu/
[7] https://aws.amazon.com/jp/blogs/news/machine-learning-fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/
[8] http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1198/55/tutorials/forecasting/index.html
[9] https://auto.gluon.ai/dev/tutorials/timeseries/index.html
[10] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-quick-start.html
[11] https://www.skygroup.jp/tech-blog/article/571/
[12] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-indepth.html
[13] https://www.hinomaruc.com/apple-hikkoshi-analytics-3-1-autogluon/
[14] https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-model-zoo.html
[15] https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/autogluon-tabular-HowItWorks.html
[16] https://note.com/lizefield/n/nf43b2c1c6bc1
[17] https://auto.gluon.ai/0.5.1/tutorials/timeseries/index.html
AutoGluon-TimeSeriesは、複数のベンチマークデータセットで高い予測精度を示しています。以下に主な性能特徴をまとめます。
ベンチマーク評価
29のベンチマークデータセットにおいて、従来の予測手法を上回る点予測および確率的予測の精度を達成[2][4]
既存手法の最適な組み合わせよりも優れた予測精度を実現[2]
主要な性能特徴
Chronos-Boltモデル
元のChronosモデルと比較して最大250倍の高速化を実現[1]
追加学習なしでも高精度な予測が可能[1]
アンサンブル手法
統計的モデルと機械学習ベースの予測アプローチを組み合わせて精度を向上[4]
WeightedEnsembleモデルが多くのケースで最高精度を達成[3]
予測の特徴
点予測と確率的予測(分位数予測)の両方に対応
時系列の季節性や傾向を考慮した予測が可能
複数の関連する時系列データを同時に予測可能
これらの性能は、AutoGluon-TimeSeriesが実務的な予測タスクにおいて信頼性の高いツールであることを示しています。
Citations:
[1] https://aws.amazon.com/jp/blogs/news/machine-learning-fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/
[2] https://openreview.net/forum?id=XHIY3cQ8Tew
[3] https://note.com/united_code/n/n5fb3c83521d3
[4] https://assets.amazon.science/24/de/d7daa2114569bb9c5c4feefd967e/autogluon-timeseries-automl-for-probabilistic-time-series-forecasting.pdf
[5] https://aws.amazon.com/jp/blogs/news/tag/autogluon/
[6] https://arxiv.org/abs/2308.05566
[7] https://www.cresco.co.jp/blog/entry/entry5293524353522381166.html
[8] https://aws.amazon.com/blogs/machine-learning/easy-and-accurate-forecasting-with-autogluon-timeseries/
[9] https://note.com/lizefield/n/nf43b2c1c6bc1
[10] https://qiita.com/dyamaguc/items/dded739f35e59a6491c8
[11] https://qiita.com/matsu3365/items/ceea9160449c88eb8272
[12] https://auto.gluon.ai/dev/api/autogluon.timeseries.TimeSeriesPredictor.html
[13] https://www.hinomaruc.com/try-autogluon-timeseries-forecasting-on-google-colab-gpu/
[14] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-metrics.html
[15] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-indepth.html
AutoGluon-TimeSeriesの学習時間は以下の要因によって変動します:
デフォルトの時間設定
time_limitパラメータで学習時間を制限できます。デフォルトでは600秒(10分)が設定されています[2]。
プリセットによる違い
選択するプリセットによって学習時間は大きく異なります:
best_quality: 最も長い学習時間が必要
high_quality: 高精度だが長時間
medium_quality: バランスの取れた時間
low_quality: 最も短い学習時間[4]
ハードウェアの影響
GPUを使用すると深層学習モデルの学習が高速化されます[14]
CPU環境では複数コアがあると学習が速くなります[14]
AWS環境では16コア以上のGPUインスタンスか、m6i.24xlargeなどのCPUインスタンスが推奨されています[14]
モデルの種類
Chronos-Boltモデルは追加学習なしで即座に予測が可能です[7]
一方で、統計モデルやディープラーニングモデルは学習に時間がかかります[2]
実際の学習時間は、データセットのサイズや時系列の長さ、選択したプリセット、使用するハードウェアなどによって大きく変動します[10]。
Citations:
[1] https://note.com/united_code/n/n5fb3c83521d3
[2] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-quick-start.html
[3] https://www.hinomaruc.com/apple-hikkoshi-analytics-3-1-autogluon/
[4] https://www.cresco.co.jp/blog/entry/entry5293524353522381166.html
[5] https://auto.gluon.ai/dev/api/autogluon.timeseries.TimeSeriesPredictor.fit.html
[6] https://www.hinomaruc.com/querying-bigquery-from-python-using-google-cloud-bigquery/
[7] https://aws.amazon.com/jp/blogs/news/machine-learning-fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/
[8] https://openreview.net/forum?id=XHIY3cQ8Tew
[9] https://acro-engineer.hatenablog.com/entry/2020/02/12/120000
[10] https://assets.amazon.science/24/de/d7daa2114569bb9c5c4feefd967e/autogluon-timeseries-automl-for-probabilistic-time-series-forecasting.pdf
[11] https://note.com/lizefield/n/nf43b2c1c6bc1
[12] https://proceedings.mlr.press/v224/shchur23a.html
[13] https://www.skygroup.jp/tech-blog/article/571/
[14] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-faq.html
[15] https://qiita.com/dyamaguc/items/dded739f35e59a6491c8
[16] https://auto.gluon.ai/dev/tutorials/timeseries/index.html
[17] http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-1198/55/tutorials/forecasting/index.html
[18] https://arxiv.org/abs/2308.05566
[19] https://dev.classmethod.jp/articles/train-autogluon-using-tensorflow-dataset/
AutoGluon-TimeSeriesの学習時間が長い場合、以下の方法で対処することができます:
プリセットの調整
低品質・高速なプリセットを選択することで学習時間を短縮できます:
`fast_training`: 単純な統計モデル(ETS、Theta、Naive、SeasonalNaive)と高速な木ベースモデルのみを使用[5]
`low_quality`: 基本的なモデルのみを使用し、最も高速に結果を得られる[1]
時間制限の設定
`time_limit`パラメータで学習時間に上限を設定できます:
predictor = TimeSeriesPredictor(
prediction_length=30,
eval_metric="MAPE"
).fit(
train_data=train_data,
time_limit=600 # 10分で学習を終了
)
ハードウェアの最適化
GPU: ディープラーニングモデルの学習を高速化できます[3]
CPU: 複数のCPUコアを使用することで、ほとんどの予測モデルの学習が高速化されます[3]
推奨スペック: AWS環境では、g5.2xlarge(GPU搭載)またはm6i.24xlarge(CPUのみ)インスタンスの使用が推奨されています[3]
データの最適化
時系列の長さが極端に長い場合、モデルの処理が遅くなる可能性があります[16]
データ量を適切なサイズに調整することで、学習時間を短縮できます
その他の対策
早期停止: 一部のディープラーニングモデルでは早期停止機能により、学習時間が短縮されます[10]
アンサンブル: 10分程度の短い時間制限でも、アンサンブル学習により良好な予測精度を維持できることが確認されています[10]
Citations:
[1] https://www.cresco.co.jp/blog/entry/entry5293524353522381166.html
[2] https://aws.amazon.com/blogs/machine-learning/easy-and-accurate-forecasting-with-autogluon-timeseries/
[3] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-faq.html
[4] https://aws.amazon.com/jp/blogs/news/machine-learning-fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/
[5] https://auto.gluon.ai/dev/api/autogluon.timeseries.TimeSeriesPredictor.fit.html
[6] https://aws.amazon.com/blogs/machine-learning/fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/
[7] https://note.com/lizefield/n/nf43b2c1c6bc1
[8] https://auto.gluon.ai/0.8.1/api/autogluon.timeseries.TimeSeriesPredictor.fit.html
[9] https://auto.gluon.ai/0.8.0/tutorials/timeseries/forecasting-faq.html
[10] https://openreview.net/pdf?id=XHIY3cQ8Tew
[11] https://note.com/currypurin/n/n7bd3153a7238
[12] https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-model-zoo.html
[13] https://community.intel.com/t5/Blogs/Tech-Innovation/Cloud/How-to-Speed-up-your-Machine-Learning-Workloads-with-Intel/post/1466284
[14] https://www.skygroup.jp/tech-blog/article/571/
[15] https://aihorizonforecast.substack.com/p/autogluon-timeseries-creating-powerful
[16] https://github.com/autogluon/autogluon/issues/3505
[17] https://www.amazon.science/publications/autogluon-timeseries-automl-for-probabilistic-time-series-forecasting
[18] https://auto.gluon.ai/dev/tutorials/timeseries/index.html
[19] https://aws.amazon.com/jp/builders-flash/202201/autogluon-tabular-tutorials/
[20] https://auto.gluon.ai/dev/api/autogluon.timeseries.TimeSeriesPredictor.html
AutoGluonの時系列予測で利用可能な評価指標を以下の表にまとめました。なお、AutoGluonではすべての評価指標が「値が大きいほど良い」形式で報告されるため、エラー指標には-1が乗算されます[2]。
![](https://assets.st-note.com/img/1737508876-T1xGuwzpMEd3re7votlOKhf0.png?width=1200)
Citations:
[1] https://aws.amazon.com/jp/blogs/news/machine-learning-fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/
[2] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-metrics.html
[3] https://note.com/366d/n/n96498719d548
[4] https://auto.gluon.ai/dev/tutorials/timeseries/index.html
[5] https://www.cresco.co.jp/blog/entry/entry5293524353522381166.html
[6] https://assets.amazon.science/24/de/d7daa2114569bb9c5c4feefd967e/autogluon-timeseries-automl-for-probabilistic-time-series-forecasting.pdf
[7] https://www.voagi.com/effective-time-series-forecasting-using-mlops-on-amazon-sagemaker.html
[8] https://auto.gluon.ai/1.1.0/tutorials/timeseries/index.html
[9] https://note.com/lizefield/n/nf43b2c1c6bc1
[10] https://schiff.co.nz/en/blog/forecasting-autogluon-notes/
[11] https://www.skygroup.jp/tech-blog/article/571/
[12] https://github.com/autogluon/autogluon/issues/4312
[13] https://jp.dotdata.com/blog/cracking-multidimensional-time-series-forecasting-with-automl/
[14] https://aihorizonforecast.substack.com/p/autogluon-timeseries-creating-powerful
[15] https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/autogluon-tabular-hyperparameters.html
[16] https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-model-zoo.html
Chronos-Boltの評価は主に以下の2つの指標を用いて行われています:
性能評価指標
予測精度の評価
加重分位数損失 (Weighted Quantile Loss: WQL): 予測の確率分布における分位点の精度を測定[1]
平均絶対スケール誤差 (Mean Absolute Scaled Error: MASE): 予測値の精度を評価する指標[1]
ベンチマーク結果
比較対象
一般的な統計モデル
深層学習モデル
他の基盤モデル[1]
注目すべき結果
Chronos-Bolt(Base)は元のChronos(Large)モデルより高い予測精度を達成[1]
27のデータセットで評価を実施[1]
学習に使用していないデータセットでも、学習済みの統計モデルや深層学習モデルを上回る性能を示す[1]
処理効率
速度とメモリ効率
元のChronosと比較して最大250倍の高速化を実現[1][4]
メモリ効率は20倍向上[1][4]
Chronos-Bolt(Base)は元のChronos(Large)と比較して600倍以上高速[4]
これらの評価結果は、Chronos-Boltが追加学習なしでも高精度な予測が可能であることを示しています。
Citations:
[1] https://aws.amazon.com/jp/blogs/news/machine-learning-fast-and-accurate-zero-shot-forecasting-with-chronos-bolt-and-autogluon/
[2] https://auto.gluon.ai/dev/tutorials/timeseries/forecasting-metrics.html
[3] https://note.com/366d/n/n96498719d548
[4] https://auto.gluon.ai/dev/tutorials/timeseries/index.html
[5] https://www.cresco.co.jp/blog/entry/entry5293524353522381166.html
[6] https://assets.amazon.science/24/de/d7daa2114569bb9c5c4feefd967e/autogluon-timeseries-automl-for-probabilistic-time-series-forecasting.pdf
[7] https://www.voagi.com/effective-time-series-forecasting-using-mlops-on-amazon-sagemaker.html
[8] https://auto.gluon.ai/1.1.0/tutorials/timeseries/index.html
[9] https://note.com/lizefield/n/nf43b2c1c6bc1
[10] https://schiff.co.nz/en/blog/forecasting-autogluon-notes/
[11] https://www.skygroup.jp/tech-blog/article/571/
[12] https://github.com/autogluon/autogluon/issues/4312
[13] https://jp.dotdata.com/blog/cracking-multidimensional-time-series-forecasting-with-automl/
[14] https://aihorizonforecast.substack.com/p/autogluon-timeseries-creating-powerful
[15] https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/autogluon-tabular-hyperparameters.html
[16] https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-model-zoo.html