From 45d1b2121fbd2c6c36d1aad407d4285e4c60715d Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Mon, 10 Jul 2023 19:35:37 +0200 Subject: [PATCH] fixes --- ml/metrics/classification_report.go | 6 +++--- ml/ml.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 ml/ml.go diff --git a/ml/metrics/classification_report.go b/ml/metrics/classification_report.go index 30b7250..4b4c204 100644 --- a/ml/metrics/classification_report.go +++ b/ml/metrics/classification_report.go @@ -42,9 +42,9 @@ func (cm *ConfusionMatrix) PrintClassificationReport() string { } accuracy := totals["correct"] / totals["true"] - s.WriteString(fmt.Sprint("\n%-26s %-10s %-10.2f %-10d", "accuracy", "", accuracy, int(totals["true"]))) + s.WriteString(fmt.Sprintf("\n%-26s %-10s %-10.2f %-10d", "accuracy", "", accuracy, int(totals["true"]))) - s.WriteString(fmt.Sprint("\n%-15s %-10.2f %-10.2f %-10.2f %-10d\n", "macro avg", + s.WriteString(fmt.Sprintf("\n%-15s %-10.2f %-10.2f %-10.2f %-10d\n", "macro avg", macroAvg["precision"]/float64(len(cm.labels)), macroAvg["recall"]/float64(len(cm.labels)), macroAvg["f1-score"]/float64(len(cm.labels)), @@ -54,7 +54,7 @@ func (cm *ConfusionMatrix) PrintClassificationReport() string { recallWeightedAvg := totals["correct"] / totals["true"] f1ScoreWeightedAvg := 2 * precisionWeightedAvg * recallWeightedAvg / (precisionWeightedAvg + recallWeightedAvg) - s.WriteString(fmt.Sprint("%-15s %-10.2f %-10.2f %-10.2f %-10d\n", "weighted avg", + s.WriteString(fmt.Sprintf("%-15s %-10.2f %-10.2f %-10.2f %-10d\n", "weighted avg", precisionWeightedAvg, recallWeightedAvg, f1ScoreWeightedAvg, int(totals["true"]))) s.WriteString(fmt.Sprintln()) diff --git a/ml/ml.go b/ml/ml.go deleted file mode 100644 index e6e3b71..0000000 --- a/ml/ml.go +++ /dev/null @@ -1 +0,0 @@ -package ml