import pandas as pd import matplotlib.pyplot as plt from fbprophet import Prophet # 读取数据集 data = pd.read_csv('network_traffic.csv') # 将数据集的列名改为ds和y data = data.rename(columns={'date': 'ds', 'traffic_volume': 'y'}) # 创建Prophet模型 model = Prophet() # 拟合模型 model.fit(data) # 创建一个未来时间段的数据框 future = model.make_future_dataframe(periods=365) # 进行预测 forecast = model.predict(future) # 绘制预测结果 fig = model.plot(forecast) plt.show()
标签:预测,Prophet,网络流量,future,fbprophet,import,model,data From: https://www.cnblogs.com/wt11/p/17323014.html