{"record":{"id":"b5b314f4b68a48e8","repo":"rohitg00/ai-engineering-from-scratch","slug":"log-scale-metric-must-be-positive-got-v","errorCode":null,"errorMessage":"log scale metric must be positive, got {v}","messagePattern":"log scale metric must be positive, got (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/53-result-evaluator/code/main.py","lineNumber":215,"sourceCode":"        raise PairingError(\"no shared seeds between candidate and baseline\")\n    return [cand_map[s] for s in shared], [base_map[s] for s in shared]\n\n\ndef _improvement(candidate_mean: float, baseline_mean: float, direction: str) -> float:\n    denom = abs(baseline_mean) if baseline_mean != 0.0 else 1.0\n    raw = (candidate_mean - baseline_mean) / denom\n    if direction == LOWER:\n        return -raw\n    return raw\n\n\ndef _log_transform(values: list[float], scale: str) -> list[float]:\n    if scale != LOG:\n        return list(values)\n    out = []\n    for v in values:\n        if v <= 0.0:\n            raise ValueError(f\"log scale metric must be positive, got {v}\")\n        out.append(math.log(v))\n    return out\n\n\n@dataclass\nclass EvaluatorConfig:\n    improvement_threshold: float = 0.02\n    significance_threshold: float = 0.05\n\n\nclass Evaluator:\n    \"\"\"Pure function over (candidate, baseline) result lists; returns a Verdict.\"\"\"\n\n    def __init__(self, config: EvaluatorConfig | None = None) -> None:\n        self._cfg = config or EvaluatorConfig()\n\n    def evaluate(\n        self,","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/53-result-evaluator/code/main.py#L197-L233","documentation":"Error \"log scale metric must be positive, got {v}\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/53-result-evaluator/code/main.py:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}