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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With