Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Jul 10, 2023
1 parent 1497c26 commit 45d1b21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ml/metrics/classification_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand All @@ -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())
Expand Down
1 change: 0 additions & 1 deletion ml/ml.go

This file was deleted.

0 comments on commit 45d1b21

Please sign in to comment.