11
2

More than 1 year has passed since last update.

Prophetを使ってみた(事前準備)

Posted at

Prophetを利用した時系列データの予測などやってみたので、備忘録も兼ねて

1. 環境

  • OS: CentOS 7.9
  • kernel: 3.10.0-1160.53.1.el7.x86_64
  • Anaconda: 3-5.3.1
  • jupyter: 4.4.0

2. OS最新化&ツールインストール

いつものようにOSは最新化します。また開発ツールパッケージも入れましょう。

yum update -y
reboot

yum groupinstall 'Development Tools' -y
yum install wget -y

3. Anacondaインストール

下記サイトからAnaconda(Linuxインストール用スクリプト)をダウンロードしてインストールします。

wgetでダウンロードし、実行します。

wget https://repo.anaconda.com/archive/Anaconda3-5.3.1-Linux-x86_64.sh
bash Anaconda3-5.3.1-Linux-x86_64.sh

Please, press ENTER to continue
>>>                                           # Enterを押す

Do you accept the license terms? [yes|no]
[no] >>> yes                                  # yesとタイプしてEnterキーを押す

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/anaconda3] >>>                         # Enterを押す

in your /root/.bashrc ? [yes|no]
[no] >>> yes                                  # yesとタイプしてEnterキーを押す

Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no                                        # noとタイプしてEnterキーを押す


source ~/.bashrc
jupyter --version

4. 仮想環境の作成

Python環境に影響を与えずにモジュールの追加・入れ替えが可能となる仮想環境を利用します。取り急ぎ、作業用ディレクトリを作成します。

mkdir -p workspace/prophet
cd workspace/prophet
mkdir data

下記コマンドから仮想環境を作成しましょう。

conda create -n prophet python=3.8 jupyter
conda activate prophet

5. Prophet関連モジュールのインストール

Prophetを利用する上で必要となるモジュールをインストールしておきます。

conda install -c anaconda pandas
conda install -c anaconda matplotlib
conda install -c anaconda scikit-learn
conda install -c anaconda plotly
conda install -c conda-forge fbprophet

6. jupyter notebookの起動

下記コマンドを実行してjupyter notebookを起動させましょう。

firewall-cmd --add-port=8888/tcp --permanent
firewall-cmd --reload
jupyter notebook --allow-root --ip=*

7. ブラウザからアクセス

無事アクセスできました。
image.png

8. その他

次回はProphetを使った予測をしていきます。

11
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
2