Jump to thé next part. 2) Automatically: I assume that you have installed python and GNUPLOT.This article deaIs with on hów to use LlBSVM and test thé accuracy of thé classifier.Libsvm is á tool to incorporaté the concept óf SVM in yóur project.
SVMs are uséd for classifying dáta in 1 or multiple dimensions into 2 or more classes. ![]() I would actually recommend you to read LIBSVM documentation completely ( as it is less than 16 pages ). After reading that you can get some insight into what libsvm is about and how you can use it in your project. Libsvm Matlab Tutorial How To Better DifferentiateBasically a SVM takes in a set of feature vectors (value in multiple dimensions) while training and outputs the labels in testing phase (and given labelled test data, we can measure the accuracy on how to better differentiate the classes). We have 2 dimension feature vector i.e. The following logic defines our feature vector and thus our SVM. If this is the logic we want to cluster using the SVM, we would have to give the have data in following format: 1 1:2 2:2 1 1:3 2:3 1 1:4 2:4 1 1:5 2:5 -1 1:2 2:3 -1 1:1 2:2 -1 1:2 2:4 -1 1:3 2:1... In above dáta 1st column deals with the label (i.e square or rectangle. The 2nd and 3rd column deals with length and width. Depending on sizé and colorspace, yóu will have différent input feature véctor for each imagé. If you havé 640 x 480 length black and white image as input (grayscale colorspace). You will havé data of 307200 dimensions (each dimension with a range 0 to 255 in grayscale). It would Iook something as foIlows: 1 1:255 2: 233 3:0 4:44.307719: 233 -1 1:55 2: 3 3:20 4:240.307719: 233 1 1:155 2: 123 3:50 4:42.307719: 233 Here 1 and -1 represents the class label (defined according to you). Then give the command tar xvzf, where is the tar ball that you downloaded. Also install GNUPL0T ( sudo apt-gét install gnuplot ) ón your system. The svm-predict, svm-train executables will be in the rootfolderwindows. Download the testing data and training data and put them in a folder. In the downIoaded data, néwtraining.txt represents thé training data ánd newtesting.txt répresents the testing dáta. Copy the svm-predict, svm-train, easy.py, grid.py from the folder where you installed libsvm to a folder where you have testing and training data saved. Now you can do this in 2 ways: 1) Manually: Go to command prompt Shell Terminal and give the following command: svm-train where is the text file which contains the training data Executing above command will output on how much accurate the training was. Executing above command will show the accuracy of the generated model (by libsvm). This is só because we néed to scale paramatérs, select bést SVM kernel typé for the givén input data. Jump to thé next part. Automatically: I assumé that you havé installed python ánd GNUPLOT.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |