Skip to content
CampusEduX

Problem 4: Calculate F1-Score Manually

Easypython
Learn the Concept: Accuracy, Precision, Recall, F1-Score

Problem Description

Write a Python program that manually calculates the F1-Score given Precision and Recall values (without using any built-in F1 function).

Input

Precision and Recall values.

Output

The calculated F1-Score.

Constraints

  • Both values are between 0 and 1.

Example Input

text
precision=0.8, recall=0.6

Example Output

text
F1-Score: 0.686

Concepts Covered

Manual F1 formula, arithmetic.

Related Problems

  • Problem 1: Calculate All Four Metrics
    Easy · python
    Solve Problem
  • Problem 2: Manually Calculate TP, TN, FP, FN
    Easy · python
    Solve Problem
  • Problem 3: Compare Precision and Recall on an Imbalanced Dataset
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...