woorulez / study

0 stars 0 forks source link

ML Dev environment - Conda, Jupyter #2

Open woorulez opened 5 years ago

woorulez commented 5 years ago

CentOS 7

  1. Install miniconda maybe go straight to anaconda
  2. create a clean environment and install anaconda
    conda create -n anaconda_py3 python=3 anaconda

    jupyter is installed as part of anaconda

  3. acitvate environment
    source activate anaconda_py3
  4. change notebook configuration (default: ~/.jupyter/jupyter_notebook_config.py)

    --- jupyter_notebook_config.py.orig     2018-12-14 20:20:14.908078274 +0900
    +++ jupyter_notebook_config.py  2018-12-14 20:22:42.962886135 +0900
    @@ -206,6 +206,7 @@
     #  module, unless it is overridden using the --browser (NotebookApp.browser)
     #  configuration option.
     #c.NotebookApp.open_browser = True
    +c.NotebookApp.open_browser = False
    
     ## Hashed password to use for web authentication.
     #
    @@ -225,7 +226,8 @@
     #c.NotebookApp.password_required = False
    
     ## The port the notebook server will listen on.
    -c.NotebookApp.port = 30001
    +#c.NotebookApp.port = 30001
    +c.NotebookApp.port = 10001
    
     ## The number of additional ports to try if the specified port is not available.
     #c.NotebookApp.port_retries = 50
  5. change password
    jupyter notebook password
  6. run (create project root first)
    mkdir -p ${PROJECT_ROOT}/jupyter && cd ${PROJECT_ROOT}/jupyter
    jupyter notebook
woorulez commented 5 years ago

daemonizing jupyter notebook

  1. using nohup
    nohup jupyter notebook &
  2. using a 3rd party service manager like supervisord
  3. using system's service manager(e.g. systemd)
  4. using go-daemon
    god -l jupyter.log -p jupyter.pid -- jupyter notebook
  5. for multi-user setup see jupyter hub
woorulez commented 5 years ago

install xgboost

# activate environment first
conda install py-xgboost

install graphviz for plotting(graphviz is not a python package)

conda install python-graphviz