使用先知在Python中预测多个时间序列

问题描述 投票:0回答:1

我上个月一直在使用先知,但总是在一个独特的时间序列上。现在,我必须预测多个时间序列,并且不知道如何去做。例如:

date        X1  X2  X3
2019-01-01  2   5   4
2019-01-01  2   6   3
2019-01-01  3   7   2
2019-01-01  4   8   4

我用于唯一时间序列的代码是这样:

import pandas as pd
import numpy as np
from fbprophet import Prophet
import matplotlib.pyplot as plt
sales_df = pd.read_csv(C:\Users...)
df=df.rename(columns={'fecha_fin':'ds', 'cantidad':'y'})
df.head()
model = Prophet()
model.fit(df)
future = model.make_future_dataframe(periods=15)
forecast = model.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail()
python time-series forecasting forecast facebook-prophet
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.