Installing Octave on Ubuntu 14.04

I’m taking Andrew Ng’s machine learning class at coursera that started June 17, 2014. In the Silicon Valley tech world, this seems to be the online course that many people recommend for machine learning. The course is taught using Octave or Matlab. I’ll use Octave because I’m on Ubuntu and Octave is a gnu project.

I will also blog about the topics covered using Python because this is my language of choice. However, I will not poster answers to exercises. Instead I will discuss the method and how to implement, or use existing tools, in Python.

First, let’s install Octave and gnuplot:

$ sudo apt-get install octave gnuplot

Accept all the suggestions (there are many) and let the installation complete. Starting Octave from the terminal should look something like this (I try out the first part of the Octave simple examples before exiting):

$ octave
GNU Octave, version 3.8.1
Copyright (C) 2014 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> A = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ]
A =

    1    1    2
    3    5    8
   13   21   34

octave:2> B = rand (3, 2);
octave:3> B
B =

   0.225359   0.115306
   0.548261   0.295556
   0.166765   0.073095

octave:4> A * B
ans =

    1.10715    0.55705
    4.75150    2.40846
   20.11315   10.19090

octave:5> exit

That’s it, Octave (version 3.8.1) is ready to go. The class website has some Octave tutorials. I also found the wikibooks Octave tutorial, which seems to cover many of the basics in a concise way.

Tags

api [1]   arduino [1]   audio [2]   audio features [1]   babel [1]   Bayesian [7]   Beta [1]   blog setup [1]   bootstrap [1]   bottleneck [1]   c++ [1]   caret [1]   cmpy [1]   conditional probability [6]   coursera [1]   coursera intro to data science [3]   css [1]   cython [1]   d3 [2]   decision trees [2]   diy [1]   dropbox [1]   dsp [1]   e1071 [1]   essentia [1]   garmin [1]   geojson [1]   ggplot2 [1]   gis [2]   git [1]   gnuplot [1]   graphs [1]   html5 [1]   igraph [1]   ipython [1]   javascript [7]   joint probability [6]   json [1]   LaTeX [2]   LDA [1]   Lea [2]   machine learning [3]   marginal probability [6]   matplotlib [1]   meteor [2]   mir [1]   MongoDB [3]   music [2]   my python setup [5]   my ubuntu setup [10]   mysql [3]   networks [1]   networkx [1]   nodejs [5]   npm [3]   numexpr [1]   numpy [1]   octave [1]   Open Oakland [2]   openpyxl [1]   pandas [3]   patsy [1]   pip [2]   pweave [1]   pygraphviz [1]   pymc [1]   PySoundFile [2]   python [15]   Python [1]   python 2.7 [5]   python 3.4 [2]   pyyaml [1]   qgis [1]   R [1]   randomForest [1]   restview [1]   resume [1]   rpart [1]   running [1]   scikit-learn [3]   scipy [1]   screen [1]   server setup [1]   shapefile [1]   social networks [1]   Socrata [1]   sound [2]   sphinx [1]   sql [4]   sqlite3 [1]   ssh [1]   ssh keys [1]   statsmodels [1]   supervised learning [2]   sympy [1]   tableau [1]   tinkerer [2]   topic models [1]   tree [1]   ubuntu 14.04 [13]   Ubuntu 14.04 [3]   ubuntu 16.04 [4]   vim [2]   virtualbox [1]   virtualenv [4]   virtualenvwrapper [3]   VPS [1]   vundle [1]   webpack [1]   yaml [1]