Multiply matrices, find determinants, and score a confusion matrix.
A x B
How to use this tool
Fill in the entries row by row.
A x B is shown with the determinant of A.
Under Advanced options, enter TP, FP, FN and TN for accuracy, precision and recall.
Matrix multiplication is not commutative: A x B generally differs from B x A.
Formula & worked example
A = [[1,2],[3,4]] times B = [[5,6],[7,8]] gives [[19,22],[43,50]], and det(A) = -2. A confusion matrix with TP 90, FP 10, FN 5, TN 95 has 92.50% accuracy, 90.00% precision and 94.74% recall.
Limitations — read this before you rely on it
The multiplication panel handles square 2×2 and 3×3 matrices. Confusion metrics need non-negative counts and at least one observation.
Frequently asked questions
Multiply each row of the first matrix by each column of the second and add the products. The inner dimensions must match.
A table of a classifier's predictions against the truth: true positives, false positives, false negatives and true negatives. It is the basis for accuracy, precision and recall.
Precision asks: of the positive predictions, how many were right? Recall asks: of the real positives, how many were found?
No. A x B and B x A are usually different, and sometimes only one of them is even defined.
For a 2×2 matrix, det = a11 x a22 – a12 x a21. A zero determinant means the matrix has no inverse (it squashes space flat).
