I use ROCR to calculate precision/recall/f-measure values for a binary classification task, but I'm not sure if I interpret the results correctly. Do I select the correct values from the slots with theses statements?
pred <- prediction(subset(result,select=1),subset(result,select=2));
prec_val <- c(prec_val,functions$scoring_function[i],performance(pred,'prec')@y.values[[1:2]]);
rec_val <- c(rec_val,functions$scoring_function[i],performance(pred,'rec')@y.values[[1:2]]);
f_val <- c(rec_val,functions$scoring_function[i],performance(pred,'f')@y.values[[1:2]]);
The "raw" results are e.g.
performance(pred,'rec')
An object of class "performance"
Slot "x.name":
[1] "Cutoff"
Slot "y.name":
[1] "Recall"
Slot "alpha.name":
[1] "none"
Slot "x.values":
[[1]]
[1] Inf 1 0
Slot "y.values":
[[1]]
[1] 0.0000000 0.4634703 1.0000000
So I would assume that the middle value in "y.values" is the recall value. Also the "Inf" value at x.values is confusing me a bit