This commit is contained in:
Chris Proctor
2026-06-22 16:08:23 -04:00
parent 95278c854d
commit 255c189d2f
9 changed files with 111 additions and 68 deletions

View File

@@ -54,6 +54,13 @@ def evaluation(y_true, y_pred, clf_name):
print(f" {digit}: {acc:.3f} {bar}")
print()
print("Confusion matrix (row=actual, col=predicted):")
header = " " + "".join(f"{d:5d}" for d in range(10))
print(header)
for actual, row in enumerate(cm):
print(f" {actual:3d} " + "".join(f"{v:5d}" for v in row))
print()
def error_analysis(X, y_true, y_pred, n):
errors = [