我有关于单位时间疾病病例数的数据,因此我可以预测疾病的爆发。我使用 Facebook Prophet 的 plot_components 函数从数据中提取基本趋势,Prophet 允许人们很容易地做到这一点:
model = Prophet()
model.fit(df)
future = model.make_future_dataframe(periods=0)
forecast = model.predict(future)
model.plot_components(forecast)
这出乎意料地让我产生了 this情节。
我需要那些 xy 值来进行我无法弄清楚的分析。 Prophet 的文档没有帮助,也没有深入研究 github 上的源代码。在返回值的图形对象上似乎也没有可调用的方法或属性。
如有任何想法,我们将不胜感激!
最佳答案
您在预测数据框中有它(检查“每周”列)
关于plot - 如何从 Prophet.plot_components() 中提取 xy 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57778723/