Classification Metrics & Confusion Matrix

Compute accuracy, precision, recall, F1, specificity, and MCC from TP/FP/FN/TN counts. Built for Machine Learning, this workbench updates the confusion matrix and scalar readouts in real time as parameters change.

Technical Reference & Equations

  • Gradient Descent with Momentum: v_t = \beta v_{t-1} + \nabla L(\theta_t), \quad \theta_{t+1} = \theta_t - \eta v_t (eta: learning rate, beta: momentum coefficient (typically 0.9).)
  • Precision, Recall & F1 Score: P = \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FP}}, \quad R = \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FN}}, \quad F_1 = \frac{2 P R}{P + R} (F1 is the harmonic mean of precision and recall, penalizing extreme imbalance.)
  • Matthews Correlation Coefficient (MCC): \mathrm{MCC} = \frac{\mathrm{TP}\cdot\mathrm{TN} - \mathrm{FP}\cdot\mathrm{FN}}{\sqrt{(\mathrm{TP}+\mathrm{FP})(\mathrm{TP}+\mathrm{FN})(\mathrm{TN}+\mathrm{FP})(\mathrm{TN}+\mathrm{FN})}} (Balanced [-1, +1] score reliable even on heavily skewed datasets.)

View full Machine Learning Formula Sheet | Constants Table

Related Machine Learning Calculators