The F1 score is equivalent to harmonic mean of the precision and recall, where the best value is 1.0 and the worst value is 0.0. The formula for F1 score is:
F1 = 2 * (precision * recall) / (precision + recall)
precision = true_positives / (true_positives + false_positives)
recall = true_positives / (true_positives + false_negatives)