Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libsvm for plotting ROC curves

I am new to libsvm, I know how to classify using libsvm. But I am not sure how to use libsvm for plotting ROC curves, the usage that is given as per libsvm's official website is:

 plotroc.py [-v cv_fold | -T testing_file] [libsvm_options] training_file

I am not getting how to substitute the same in my program. I want to implement a binary classifier. I am new to libsvm, so sorry for such a novice question. Also I have my data in numpy.ndarray format...I am not sure how to create testing file out of the same.

I would be really thankful, if somebody could give a toy example for the same.

like image 908
user1355603 Avatar asked Nov 14 '22 06:11

user1355603


1 Answers

To use that one script you need a file in LIBSVM format, you can look through the examples of LIBSVM to see what the format is: class 1:value 2:value ... n:value \n

Then you can either do cross validation on the training data or give another file with testing data (in the same LIBSVM format) and plot the ROC of that data. You also need to give the LIBSVM options -C 1 -g 0.01 -t 2 or whatever so you need to know the parameters for the classifier.

like image 121
carlosdc Avatar answered Dec 07 '22 23:12

carlosdc