This tool calculates and displays the accuracy, precision, recall, and F1 score of your classification model.

## Confusion Matrix Calculator

This calculator helps you compute key performance metrics of classification models based on the confusion matrix.

### How to Use:

- Enter the values for True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN).
- Click the “Calculate” button to get the results.
- The calculator will display the Accuracy, Precision, Recall, and F1 Score.

### How it Calculates:

**Accuracy:**(TP + TN) / (TP + FP + TN + FN)**Precision:**TP / (TP + FP)**Recall:**TP / (TP + FN)**F1 Score:**2 * (Precision * Recall) / (Precision + Recall)

### Limitations:

- Does not handle cases where any input is zero, which may lead to division by zero errors.
- Does not accept decimal or non-integer values.
- The accuracy of the results depends on the correctness of the entered values.

## Use Cases for This Calculator

### Calculate True Positive (TP) in a Confusion Matrix

To calculate True Positive (TP) in a confusion matrix, you need to input the total number of actual positive cases and the number of correctly predicted positive cases. The calculator will give you the TP value.

### Calculate True Negative (TN) in a Confusion Matrix

To determine True Negative (TN), provide the total number of actual negative cases and the number of correctly predicted negative cases. The calculator will compute the TN value for you.

### Calculate False Positive (FP) in a Confusion Matrix

For False Positive (FP), enter the number of actual negative cases and the number of incorrectly predicted positive cases. The calculator will do the math and present you with the FP value.

### Calculate False Negative (FN) in a Confusion Matrix

Input the total number of actual positive cases and the number of incorrectly predicted negative cases to get the False Negative (FN) value. The calculator will help you quickly obtain the FN value.

### Calculate Sensitivity (True Positive Rate) in a Confusion Matrix

To compute Sensitivity (True Positive Rate), provide the TP and FN values. The calculator will give you the Sensitivity percentage, a crucial metric in evaluating classification models.

### Calculate Specificity (True Negative Rate) in a Confusion Matrix

By entering the TN and FP values, you can determine the Specificity (True Negative Rate) using the calculator. Specificity is essential in assessing a model’s ability to predict negative outcomes correctly.

### Calculate Precision (Positive Predictive Value) in a Confusion Matrix

For Precision (Positive Predictive Value), input the TP and FP values. The calculator will provide you with the Precision percentage, which indicates the accuracy of positive predictions.

### Calculate F1 Score (F1 Measure) in a Confusion Matrix

To calculate the F1 Score (F1 Measure), enter the Precision and Recall values. The calculator will help you determine the harmonic mean between Precision and Recall for a balanced performance metric.

### Calculate Accuracy in a Confusion Matrix

By inputting the TP, TN, FP, and FN values, you can easily calculate the overall Accuracy using the calculator. Accuracy measures the proportion of correct predictions among all cases.

### Calculate Error Rate in a Confusion Matrix

To determine the Error Rate, provide the TP, TN, FP, and FN values. The calculator will compute the percentage of incorrect predictions made by the model across all cases.