Spaces:
No application file
No application file
Download eval (1).py from dee2004/rl-study-scheduler: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/spaces/dee2004/rl-study-scheduler/resolve/main/eval%20(1).py
- Command line
-
hf download 'hf://spaces/dee2004/rl-study-scheduler/eval (1).py'
-
curl -L -o 'eval (1).py' 'https://huggingface.co/spaces/dee2004/rl-study-scheduler/resolve/main/eval%20(1).py'
507 Bytes
| def evaluate(state): | |
| tasks = state["tasks"] | |
| completed = sum(1 for t in tasks if t["completed"]) | |
| missed = sum(1 for t in tasks if not t["completed"] and t["deadline"] <= 0) | |
| avg_stress = state["student"]["stress"] | |
| efficiency = completed / len(tasks) if len(tasks) > 0 else 0 | |
| return { | |
| "tasks_completed": completed, | |
| "missed_deadlines": missed, | |
| "avg_stress": avg_stress, | |
| "efficiency_score": round(efficiency, 2), | |
| "total_tasks": len(tasks) | |
| } | |