Prophet 1.0 : 概要 (翻訳/解説)
翻訳 : (株)クラスキャット セールスインフォメーション
作成日時 : 06/29/2021 (1.0)
* 本ページは、Prophet の以下のドキュメントを翻訳した上で適宜、補足説明したものです:
* サンプルコードの動作確認はしておりますが、必要な場合には適宜、追加改変しています。
* ご自由にリンクを張って頂いてかまいませんが、sales-info@classcat.com までご一報いただけると嬉しいです。
スケジュールは弊社 公式 Web サイト でご確認頂けます。
- お住まいの地域に関係なく Web ブラウザからご参加頂けます。事前登録 が必要ですのでご注意ください。
- ウェビナー運用には弊社製品「ClassCat® Webinar」を利用しています。
人工知能研究開発支援 | 人工知能研修サービス | テレワーク & オンライン授業を支援 |
PoC(概念実証)を失敗させないための支援 (本支援はセミナーに参加しアンケートに回答した方を対象としています。) |
◆ お問合せ : 本件に関するお問い合わせ先は下記までお願いいたします。
株式会社クラスキャット セールス・マーケティング本部 セールス・インフォメーション |
E-Mail:sales-info@classcat.com ; WebSite: https://www.classcat.com/ ; Facebook |
Prophet 1.0 : 概要
Prophet は加法モデルに基づき時系列データを予測するための手続きです、そこでは毎年、毎週そして毎日の季節性 (= seasonality) 及び休日の影響による非線形トレンドが適合されます。それは強い季節的影響と幾つかの季節の履歴データを持つ時系列で最善に動作します。Prophet は欠測データとトレンドの変化に対して堅牢で、典型的には外れ値を上手く処理します。
Prophet は Facebook の Core データサイエンス・チーム によりリリースされた オープンソース・ソフトウェア です。ダウンロードのために CRAN と PyPI で利用可能です。
重要なリンク
- ホームページ: https://facebook.github.io/prophet/
- HTML ドキュメント: https://facebook.github.io/prophet/docs/quick_start.html
- Issue tracker: https://github.com/facebook/prophet/issues
- ソースコード・レポジトリ: https://github.com/facebook/prophet
- Contributing: https://facebook.github.io/prophet/docs/contributing.html
- Prophet R パッケージ: https://cran.r-project.org/package=prophet
- Prophet Python パッケージ: https://pypi.python.org/pypi/prophet/
- リリース・ブログ投稿: https://research.fb.com/prophet-forecasting-at-scale/
- Prophet paper: Sean J. Taylor, Benjamin Letham (2018) Forecasting at scale. The American Statistician 72(1):37-45 ( https://peerj.com/preprints/3190.pdf ).
Python でインストール
Prophet は PyPi 上ですので、それをインストールするために pip を利用できます。v0.6 以後、Python 2 はもはやサポートされません。v1.0 の時点で、PyPI 上のパッケージ名は “prophet” です ; v1.0 以前はそれは “fbprophet” でした。
# Install pystan with pip before using pip to install prophet
# pystan>=3.0 is currently not supported
pip install pystan==2.19.1.1
pip install prophet
Prophet が持つデフォルトの依存性は pystan です。PyStan はそれ自身の インストール手順 を持ちます。prophet をインストールするために pip を使用する前に pip で pystan をインストールしてください。
参考 : PyStan インストール
※ 但し、Anaconda 環境については別途後述されますので併せて読んでください。
PyPI から PyStan をインストールするためには貴方のシステムが要件を満たしていることを確認してください :
- Python ≥3.7
- Linux or macOS
- x86-64 CPU
- C++ compiler: gcc ≥9.0 or clang ≥10.0.
# gcc 9.x のインストール sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install g++-9-multilib # デフォルト設定 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 30 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 30 update-alternatives --display gcc
pip で PyStan をインストールします。次のコマンドは PyStan をインストールします :
python3 -m pip install pystan
サポートされる Linux ディストリビューション
2 つの公式にサポートされる Linux ディストリビューションがあります :
- Debian 11
- Ubuntu 20.04
Users have reported that PyStan works on several other Linux distributions. If you use an unsupported distribution and find that the PyPI wheels do not work, try installing httpstan from source. Once httpstan is installed, PyStan should work.
Experimental backend – cmdstanpy
(省略)
Anaconda
gcc をセットアップするためには “conda install gcc” を使用します。Prophet をインストールする最も簡単な方法は conda-forge 経由です : “conda install -c conda-forge prophet”
Linux
Make sure compilers (gcc, g++, build-essential) and Python development tools (python-dev, python3-dev) are installed. In Red Hat systems, install the packages gcc64 and gcc64-c++. If you are using a VM, be aware that you will need at least 4GB of memory to install prophet, and at least 2GB of memory to use prophet.
以上