Prophet 是由 Facebook 开发的一个开源时间序列预测工具,专门用于预测时间序列数据,特别是具有季节性、节假日效应的数据
1.0版本之前 fbprophet 之后名字更新 prophet 新版最低支持python3.7
- From v0.6 onwards, Python 2 is no longer supported.
- As of v1.0, the package name on PyPI is “prophet”; prior to v1.0 it was “fbprophet”.
- As of v1.1, the minimum supported Python version is 3.7.
prophet安装
安装 fbprophet之前需要安装前置依赖
创建虚拟环境使用conda安装
conda create -n py37 python=3.7
启动虚拟环境
conda activate py37
安装prophet
conda install -c conda-forge prophet
网络很重要 务必使用数据流量
以下是使用 prophet
进行时间序列预测的基本示例:
# Python
import pandas as pd
from prophet import Prophet
import matplotlib.pyplot as plt
# 创建示例数据 ds列 即时间序列 y列即 数值序列 序列个数必须相同