housebot / judge.py
DronA23's picture
Create judge.py
5f75f34 verified
raw
history blame contribute delete
479 Bytes
def judge_model(model_type: str, metrics: dict) -> dict:
comments = []
verdict = "Pass"
if model_type == "linear":
r2 = metrics.get("r_squared", 0)
if r2 < 0.7:
verdict = "Fail"
comments.append(f"R² too low: {r2}")
else:
acc = metrics.get("accuracy", 0)
if acc < 0.7:
verdict = "Fail"
comments.append(f"Accuracy too low: {acc}")
return {"verdict": verdict, "comments": comments}