$sudo apt-get upgrade
$sudo apt-get update
$sudo apt-get install octave
$sudo apt-get install liboctave-dev
After this, download the LibSVM from the following link:
unzip by running the tar xfz [libsvm tar file] command
create a working directory under your $HOME directory with a name, said, "OctaveProjects". now copy the unzipped libsvm-3.20 folder into the OctaveProjects folder.
Now type "octave" in the search box of Ubuntu to launch it, in the octave program, type the following command to goto the libsvm's matlab folder:
type the following command to invoke the make.m in the libsvm's matlab folder:
Once the matlab interface for libsvm has been built, go back to the OctaveProjects folder by typing the following command:
Now run the following command to add the libsvm path:
You can now run the libsvm, below is the usage from README in libsvm:
octave> model = svmtrain(training_label_vector, training_instance_matrix [, 'libsvm_options']);
An m by 1 vector of training labels (type must be double).
An m by n matrix of m training instances with n features.
It can be dense or sparse (type must be double).
A string of training options in the same format as that of LIBSVM.
octave> [predicted_label, accuracy, decision_values/prob_estimates] = svmpredict(testing_label_vector, testing_instance_matrix, model [, 'libsvm_options']);
octave> [predicted_label] = svmpredict(testing_label_vector, testing_instance_matrix, model [, 'libsvm_options']);