gluonts
0.16.0
? Breaking News : 우리는 제로 샷 시계열 예측을위한 사전 사전 모델 제품군 인 Chronos를 발표했습니다. 크로노스는 훈련 중에 보이지 않는 새로운 시계열에 대한 정확한 확률 예측을 생성 할 수 있습니다. 여기에서 확인하십시오!
Gluonts는 Pytorch 및 MXNet을 기반으로 한 딥 러닝 기반 모델에 중점을 둔 확률 시계열 모델링을위한 Python 패키지입니다.
Gluonts는 Python 3.7 이상이 필요하며 설치하는 가장 쉬운 방법은 pip 통해입니다.
# install with support for torch models
pip install " gluonts[torch] "
# install with support for mxnet models
pip install " gluonts[mxnet] "글루온트를 설치하는 방법에 대한 자세한 내용은 문서를 참조하십시오.
Gluonts 사용 방법을 설명하기 위해 Deepar-Model을 훈련시키고 Airpassengers 데이터 세트를 사용하여 예측합니다. 이 데이터 세트는 1949 년에서 1960 년 사이의 월간 승객 수의 단일 시계열로 구성됩니다. 우리는 처음 9 년 동안 모델을 훈련시키고 나머지 3 년 동안 예측합니다.
import pandas as pd
import matplotlib . pyplot as plt
from gluonts . dataset . pandas import PandasDataset
from gluonts . dataset . split import split
from gluonts . torch import DeepAREstimator
# Load data from a CSV file into a PandasDataset
df = pd . read_csv (
"https://raw.githubusercontent.com/AileenNielsen/"
"TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv" ,
index_col = 0 ,
parse_dates = True ,
)
dataset = PandasDataset ( df , target = "#Passengers" )
# Split the data for training and testing
training_data , test_gen = split ( dataset , offset = - 36 )
test_data = test_gen . generate_instances ( prediction_length = 12 , windows = 3 )
# Train the model and make predictions
model = DeepAREstimator (
prediction_length = 12 , freq = "M" , trainer_kwargs = { "max_epochs" : 5 }
). train ( training_data )
forecasts = list ( model . predict ( test_data . input ))
# Plot predictions
plt . plot ( df [ "1954" :], color = "black" )
for forecast in forecasts :
forecast . plot ()
plt . legend ([ "True values" ], loc = "upper left" , fontsize = "xx-large" )
plt . show ()예측은 확률 분포 측면에서 표시되며 음영 영역은 50% 및 90% 예측 간격을 나타냅니다.
프로젝트에 기여하려면 기여 가이드 라인을 참조하십시오.
과학적 간행물에서 글루온트를 사용하는 경우 작업과 관련된 모델 별 참조 외에도 관련 논문에 대한 다음 참조를 추가하는 것이 좋습니다.
@article { gluonts_jmlr ,
author = { Alexander Alexandrov and Konstantinos Benidis and Michael Bohlke-Schneider
and Valentin Flunkert and Jan Gasthaus and Tim Januschowski and Danielle C. Maddix
and Syama Rangapuram and David Salinas and Jasper Schulz and Lorenzo Stella and
Ali Caner Türkmen and Yuyang Wang } ,
title = { {GluonTS: Probabilistic and Neural Time Series Modeling in Python} } ,
journal = { Journal of Machine Learning Research } ,
year = { 2020 } ,
volume = { 21 } ,
number = { 116 } ,
pages = { 1-6 } ,
url = { http://jmlr.org/papers/v21/19-820.html }
} @article { gluonts_arxiv ,
author = { Alexandrov, A. and Benidis, K. and Bohlke-Schneider, M. and
Flunkert, V. and Gasthaus, J. and Januschowski, T. and Maddix, D. C.
and Rangapuram, S. and Salinas, D. and Schulz, J. and Stella, L. and
Türkmen, A. C. and Wang, Y. } ,
title = { {GluonTS: Probabilistic Time Series Modeling in Python} } ,
journal = { arXiv preprint arXiv:1906.05264 } ,
year = { 2019 }
}