我有几个半小时的数据。它的形式是:
05/10/2017 00:00:00, 116.297
05/10/2017 00:30:00, 7.3748
05/10/2017 01:00:00, -94.8402
05/10/2017 01:30:00, 41.0546
05/10/2017 02:00:00, 206.3658
05/10/2017 02:30:00, -283.0569
05/10/2017 03:00:00, -656.2
05/10/2017 03:30:00, 631.2834
我想预测未来 24 小时(即 48 个半小时)。我的代码似乎给出了比这更长的预测。见情节:
这里是:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from fbprophet import Prophet
# Load data
file_name = "test_data.csv"
df = pd.read_csv(file_name,parse_dates=[0])
#Fit the model
m = Prophet().fit(df)
#Make predictions
future = m.make_future_dataframe(periods=48, freq=H)
fcst = m.predict(future)
m.plot(fcst)
plt.show()
我没有make_future_dataframe
正确设置方法吗?