Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions misterdev/core/evolution/partial_credit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
regressions==0 + resolved_rate (see fitness.py). Pure and deterministic.
"""

import math
from dataclasses import dataclass
from typing import Iterable, Optional, Sequence, Tuple

Expand Down Expand Up @@ -99,8 +100,8 @@ def variance(self) -> float:
"""Sample variance of the per-task credits (population form)."""
if self.total < 1:
return 0.0
m = self.mean_credit
return sum((c - m) ** 2 for c in self.credits) / self.total
m = math.fsum(self.credits) / self.total
return math.fsum((c - m) ** 2 for c in self.credits) / self.total

@property
def stderr(self) -> float:
Expand Down
Loading