# How to compute F1 score?

Recently I read about path ranking algorithm in a paper (source: Knowledge Vault: A Web-Scale Approach to Probabilistic Knowledge Fusion).

In this paper was a table (Table 3) with facts and I tried to understand how they were calculated.

F1 (harmonic mean of precision and recall) = 0.04
P (precision) = 0.03
R (recall) = 0.33
W (weight given to this feature by logistic regression)

I found a formula for F1 via Google which is

$F1 = 2 * \frac{precision * recall}{precision + recall}$

The problem is that I get the result of 0.055 with this formula, but not the expected result of 0.04. Can someone help me to get this part? Also, does someone know how 'W' can be calculated? Thanks.

• Their calculation looks simply wrong. The F1 column is not the harmonic mean, not even to the number of decimal places shown. – Sean Owen Feb 3 '15 at 11:55
• Sounds like i should contact one of the authors of the paper. – Sven Lauterbach Feb 4 '15 at 12:49
• The values of F1 calculated in Orange Test and Score widget are erroneous – Arvind Prasad Jun 21 '18 at 18:24

First you need to learn about Logistic Regression, it is an algorithm that will assign weights to different features given some training data. Read the wiki intro, is quite helpful, basically the Betas there are the same as the Ws in the paper.

The formula you have is correct, and those value do seem off. It also depends on the number of significant figures you have, perhaps they are making their calculations with more than the ones they are reporting.

But honestly, you can't understand much of the paper unless you understand LR

• i will try to take a further look at logistic regression. Do you know any good source/webpage which explains logistic regression as easy as possible? – Sven Lauterbach Feb 2 '15 at 18:13
• Is pretty well explained in this set of notes cs229.stanford.edu/notes/cs229-notes1.pdf – Leon palafox Feb 2 '15 at 19:13