I could not calculate the precision and recall correctly in the code below:
Can you please help to fix the formula for them. Here is the code segment: