DronA23 commited on
Commit
5f75f34
·
verified ·
1 Parent(s): 7fd2dc9

Create judge.py

Browse files
Files changed (1) hide show
  1. judge.py +14 -0
judge.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def judge_model(model_type: str, metrics: dict) -> dict:
2
+ comments = []
3
+ verdict = "Pass"
4
+ if model_type == "linear":
5
+ r2 = metrics.get("r_squared", 0)
6
+ if r2 < 0.7:
7
+ verdict = "Fail"
8
+ comments.append(f"R² too low: {r2}")
9
+ else:
10
+ acc = metrics.get("accuracy", 0)
11
+ if acc < 0.7:
12
+ verdict = "Fail"
13
+ comments.append(f"Accuracy too low: {acc}")
14
+ return {"verdict": verdict, "comments": comments}