mirror of
https://github.com/Steffo99/unimore-bda-6.git
synced 2024-11-21 23:44:19 +00:00
Properly accumulate errors in EvaluationResults
This commit is contained in:
parent
dc08a6ce0f
commit
18b367db6f
1 changed files with 2 additions and 0 deletions
|
@ -81,6 +81,8 @@ class EvaluationResults:
|
||||||
|
|
||||||
def __add__(self, other: EvaluationResults) -> EvaluationResults:
|
def __add__(self, other: EvaluationResults) -> EvaluationResults:
|
||||||
new = self.__class__()
|
new = self.__class__()
|
||||||
|
new.absolute_error_total = self.absolute_error_total + other.absolute_error_total
|
||||||
|
new.squared_error_total = self.squared_error_total + other.squared_error_total
|
||||||
for expected, value in self.confusion_matrix.items():
|
for expected, value in self.confusion_matrix.items():
|
||||||
for predicted, amount in value.items():
|
for predicted, amount in value.items():
|
||||||
new.confusion_matrix[expected][predicted] += amount
|
new.confusion_matrix[expected][predicted] += amount
|
||||||
|
|
Loading…
Reference in a new issue