Коллекция предсказаний
if "google.colab" in str(get_ipython()):
# удаление предустановленных пакетов из Colab, чтобы избежать конфликтов
!pip uninstall -y torch notebook notebook_shim tensorflow tensorflow-datasets prophet torchaudio torchdata torchtext torchvision
!pip install git+https://github.com/ourownstory/neural_prophet.git # может занять некоторое время
#!pip install neuralprophet # намного быстрее, но может не иметь последних обновлений/исправлений ошибок
import pandas as pd
from neuralprophet import NeuralProphet, set_log_level
set_log_level("ERROR")
data_location = "https://raw.githubusercontent.com/ourownstory/neuralprophet-data/main/datasets/"
df = pd.read_csv(data_location + "air_passengers.csv")
df.tail(3)ds
y
m = NeuralProphet(n_lags=5, n_forecasts=3)
metrics_train = m.fit(df=df, freq="MS")Получение последнего прогноза df
ds
y
yhat1
ds
y
yhat6
yhat5
yhat4
yhat3
yhat2
yhat1
ds
y
yhat1
Собирайте прогнозы в выборке
Прогнозы отсортированы по цели прогноза
ds
y
yhat1
residual1
yhat2
residual2
yhat3
residual3
ar1
ar2
ar3
trend
season_yearly
Прогнозы на основе начала прогноза
ds
step0
step1
step2
ds
step0
step1
step2
trend0
trend1
trend2
season_yearly0
season_yearly1
season_yearly2
ar0
ar1
ar2
Собирайте прогнозы вне выборки
ds
y
Прогнозы на основе прогнозируемой цели
ds
y
yhat1
residual1
yhat2
residual2
yhat3
residual3
ar1
ar2
ar3
trend
season_yearly
Прогнозы на основе начала прогноза
ds
step0
step1
step2
Last updated