This repository contains a Python implementation for calculating the F1 score and other classification metrics. It analyzes true positives, false positives, true negatives, and false negatives from binary classification data, providing insights into model performance. Suitable for data scientists and machine learning enthusiasts.
- Calculation of True Positives (TP)
- Calculation of False Positives (FP)
- Calculation of True Negatives (TN)
- Calculation of False Negatives (FN)
- Metrics: Accuracy, Precision, Recall, and F1 Score
-
Accuracy:
$\text{Accuracy} = \frac{TP + TN}{TP + FP + TN + FN}$ -
Precision:
$\text{Precision} = \frac{TP}{TP + FP}$ -
Recall:
$\text{Recall} = \frac{TP}{TP + FN}$ -
F1 Score:
$\text{F1 Score} = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}$
- Clone the repository:
git clone https://github.com/hesam2801/F1Score.git
- Navigate to the directory:
cd F1Score - Run the script:
python main.py
- Python 3.x
- NumPy
This project is licensed under the MIT License.
Feel free to modify any sections as needed!