2016年3月16日 星期三

Jupyter Notebook with Octave Kernel

在學 machine learning 時常會用到兩種 languages.  一類是 matlab or octave (e.g. Andrew Ng).

另一類是 python (e.g. sckit-learn, etc., 林軒田; UC Washington ML classes).   少數用 R and maybe other languages.

 

Matlab/Octave 的好處是簡單清楚。處理 vector or matrix or plot 乾淨利落。缺點是 large scale ML 的速度太慢。另外 matlab/octave 沒有很好的 notebook UI.

Python 則相反。即使在用 ipython 的 vector, matrix, plot, 仍然處處有 python 的影子。但好處是速度快, scalable.  最重要的是 ipython notebook 是非常簡單好用的 math or engineering notebook UI.

是否能結合兩者?  Yes, Jupyter Noteook.   Jupyter notebook 是 ipython notebook 的下一代。把 UI 和 kernel 分開。 UI 就是 ipython notebook interface. 

Kernel 則可以是 python, octave, matlab, R, etc.

 

為了要 install Jupyster, 首先 install python. 

 

Step 1: Use Vmware to install Ubuntu 14.04.4 (TLS) version.  

Detailed refer to previous article.  

為了方便再 install Dropbox (ubuntu version) for .bashrc, and install kompare, kdiff3, emacs

Step 2: Install Anaconda python (3).   

-> Recommend to use Anaconda python 3.5 from the Jupyter website.

Download PYTHON 3.5 64-bit version (Anaconda3-2.5.0-Linux-x86_64.sh)

=>  bash ...

 

(1) Do "conda install jupyter  -> update jupyter related files

(2) Do "pip install bash_kernel"  -> No need for Octave kernel

 

Step 3: install octave:   sudo apt-get install octave

(3) Do "pip install octave_kernel" 

(4) Do "python -m octave_kernel.install"

 

--> Done.

 

You can either do on the web:

jupyter notebook -> choose new octave notebook

or 

jupyter qtconsole --kernel octave

jupyter console --kernel octave

 

It works now!

沒有留言:

張貼留言

追蹤者