http://stackoverflow.com/questions/23696609/what-are-the-matlab-perfcurve-roc-curve-parameters

 

see documentation of percurve, posclass is the label of positive class, in your case it has to be either 1,-1 or 2 http://www.mathworks.com/help/stats/perfcurve.html

ROC curve have "false positive rate" on x axis and "true positive rate on y axis". By specifying the posclass, you are specifying with respect to which class you are calculating false positive rate and true positive rate. e.g. if you specify posclass as 2, you consider that when the true label is 2, predicting either 1 or -1 is considered a false prediction (false negative).

Edit: The accuaracy_score you metioned (in my version of the documentation(3.17, in matlab folder), it is called decision_values/prob_estimates) have 3 column, each column correspond to the probability of the data belonging to one class.

e.g.

model=svmtrain(train_label,train_data);
[predicted_label, accuracy, decision_values]=predict(test_label,test_dat,model);

model.Label contains the class labels, individual columns in decision_values contains probability of the the test case belong to class specified in model.Label.(see http://www.csie.ntu.edu.tw/~b91082/SVM/README).

to use purfcurve to compute ROC for class m:

[X,Y] = perfcurve(truelabels, decision_values(:,m)*model.Label(m),model.Label(m));

It is essential to do decision_values(:,m)*model.Label(m) especially when you class label is a negative number.

'Machine Learning' 카테고리의 다른 글

L1 Norm / L2 Norm  (0) 2016.11.23
Machine Learning FAQ  (0) 2016.11.23
Accuracy, Sensitivity, and Specificity  (0) 2016.10.26
머신러닝 관련 포스트 번역  (0) 2016.08.11
Machine learning - → Professur Künstliche Intelligenz  (0) 2016.03.09
Posted by uniqueone
,