How can i calculate sensitivity(True positive rate) and specificity(True negative rate) using libsvm as a binary classifier in matlab? -
i working on face verification problem.i using libsvm classifier. want calculate true positive rate , true negative rate.
by using these 2 performance measures, want calculate equal error rate , want draw roc curve.
i read perfcurve command in matlab.but here score means in command.??
if using libsvm, there 3 possible return values svmpredict function.
[predicted_label, accuracy, decision_values] = svmpredict(testing_label_vector, testing_instance_matrix, model [,'libsvm_options']); if don't specify want return values, assigning output using several variables, first variable, predicted_label.
if want produce roc curve, need classifier scores each instance in order calculate thresholds. scores decision_values.
you can use either roc or plotroc neural network toolkit or perfcurve machine learning toolkit generate roc curve.
for true positive , false positive rates @ each threshold in form of cell array, use
[tpr,fpr,thresholds] = roc(ground_truth, decision_values); for plot of roc curve, use
plotroc(ground_truth, decision_values); or
[x,y] = perfcurve(ground_truth, decision_values, positive_class_name); plot(x,y); see roc curve binary classifier in matlab perfcurve example.
Comments
Post a Comment