How to Use libsvm in linux with Ubuntu (installation and test)

step_1 Download the original sources from website

  1. you could click it or use the command wget
  2. then you will get the file like following:
    在这里插入图片描述

step_2 decompress the download file into “libsvm-3.25”

  1. use the command tar -zxvf libsvm-3.25.tar.gz and you will get the following file
    在这里插入图片描述

step_3 compile the source file into executable file

  1. use sudo chmod 777 libsvm-3.25 to give the file power to compile
  2. cd libsvm-3.25/
  3. make
  4. then you will see some executive files
    在这里插入图片描述

step_4 now you could find a dataset to conduct your experiment

  1. I test my work with data file heart_scale

  2. use the command ./svm-train heart_scale(note that heart-scale and svm-train are in same path folder) to train the default svm model with heart_scale database, the results shows as follows:
    How to Use libsvm in linux with Ubuntu (installation and test)_第1张图片
    在这里插入图片描述

  3. Then use the command ./svm-predict heart_scale heart_scale.model heart_scale.predict to test the accuracy heart_scale.model. Note that owing to no file heart_scale.t in this folder, I JUST use the training database to make this test and got the following results:
    在这里插入图片描述

Anyway, I just to say the process installing libsvm into my linux is correct. and I log it just to wish it could help more folks know about this awesome portable classication tools.

你可能感兴趣的:(Python,assignments,libsvm,SVM,linux)