calculating recall and precision confusion I got 100 text, 9 labeled as + and 91 labeled as -. My classifier predicted, 45 as + and 55 as -
So I have been asking myself this question. Out of 45+ predicted text, how many are actually +: answer = 9. Out of 55- predicted text, how many are actually -: answer = 3.
Precision = 9/12
Recall = 9/45
Are these corrects? I ask because I have looked at the wiki and other websites for examples but their predicted values tend to be less than the labeled values and in my case it is the opposite so I'm tearing my hairs out as how to calculate them.
Thanks.
Edit: After rechecking my figures, this is my confusion matrix:
                  Labeled
                 | +  | -  |
                 -----------
   Predicted | + | 9  | 36 |
             | - | 0  | 55 |

Edit: Realised my mistake, I have flipped the confusion matrix wrong way around...
So now recall= 9/9 = 1 and precision= 9/45 = 0.2 
 A: Unfortunately, you've got them backwards. 
Both quantities have the number true positives in the numerator. A 'true positive' is one which is both labeled and predicted to be '+'. You have 9 true positives here (top-left entry of the confusion matrix). The difference between precision and recall is in the denominator.
Precision is the proportion of retrieved documents (i.e., predicted +) that are actually relevant (i.e., labeled +). The denominator is therefore the sum of the true positives (predicted +, labeled +), and the false positives (predicted + but labeled -). You have 9 true positives and 36 false positives. 9+36 = 45, so your precision is 9/45=1/5=0.2. 
Recall goes the other way: Of the universe of relevant documents (labelled +), how many did you actually find? The numerator is still the number of true positives, but the denominator is now the sum of the true positives and false negatives (predicted - but labeled +). You have 9 true positives and no false negatives, so your recall is 9/9 = 1.
Note that the true negative rate (predicted and labeled -) never enters into these calculations. 
Recall is a measure of the "comprehensiveness" of your system, while precision tells you something about how useful the returned results are likely to be.  Since you can trivially max out recall at the expense of precision (predict everything is+ and voilà! 100% recall) and vice versa, you need to find a balance that is good for your application. For Google, precision is way more important than recall (Do you really need 20M pages of cat photos? No, no you don't), but recall might be more important when searching your own documents.
