Spaces:
No application file
No application file
File size: 2,791 Bytes
9f53c11 0033d19 a525678 0033d19 a525678 0033d19 a525678 0033d19 a525678 0033d19 a525678 0033d19 a525678 0033d19 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | ---
title: RL Study Scheduler
emoji: π
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: "4.0.0"
app_file: inference.py
pinned: false
---
# RL-Based Adaptive Study Scheduler
> Q-learning agent vs heuristic baseline for cognitive-aware study planning.
## Demo Output

---
## Overview
This project models study planning as a sequential decision-making problem under cognitive and temporal constraints. Instead of static prioritization rules, a **Reinforcement Learning (RL) agent** learns to optimize task scheduling dynamically.
**Core insight**: Adaptive scheduling under stress is not a sorting problem β it's a **learning problem**.
---
## Results: RL vs Heuristic Baseline
| Metric | RL Agent | Baseline | Winner |
|--------|----------|----------|--------|
| Avg Reward | Higher | Lower | RL β
|
| Tasks Completed | More | Less | RL β
|
| Missed Deadlines | Fewer | More | RL β
|
| Avg Stress | Lower | Higher | RL β
|
| Efficiency Score | Higher | Lower | RL β
|
**Key finding**: RL outperforms heuristic scheduling under high stress and tight deadlines.
---
## Live Demo
π€ **[Try it on Hugging Face Spaces](https://huggingface.co/spaces/dee2004/rl-study-scheduler)**
---
## MDP Formulation
### State Space
```
energy (0-100), stress (0-100), focus (0-100),
pending tasks, min deadline, max difficulty
```
### Action Space
```
DO_TASK | BREAK | SKIP | SWITCH
```
### Reward Function
| Event | Reward |
|-------|--------|
| Task completion | +10 |
| Difficult task (difficulty > 7) | +5 |
| Urgent task completed (deadline < 2) | +4 |
| Missed deadline | -8 |
| Burnout (energy < 20) | -10 |
| High stress (> 80) | -5 |
| Context switching | -2 |
| Self-care break | +2 |
---
## How to Run
```bash
pip install -r requirements.txt
python compare.py # Train + compare
python plot.py # Generate chart
python inference.py # Launch Gradio UI locally
```
---
## Project Structure
```
rl-study-scheduler/
βββ env.py # RL environment (MDP)
βββ agent_q.py # Q-learning agent
βββ baseline.py # Heuristic policy
βββ reward.py # Reward function
βββ compare.py # Training + comparison
βββ eval.py # Metrics
βββ plot.py # Visualization
βββ llm_grader.py # LLM qualitative evaluation
βββ inference.py # Gradio app
βββ requirements.txt
```
---
## Why RL?
| Requirement | Rule-based | RL |
|---|---|---|
| Sequential decisions | β | β
|
| Delayed rewards (rest now β no burnout later) | β | β
|
| Adapts to energy/stress state | β | β
|
| Learns from experience | β | β
|
---
## Tech Stack
- Python 3.8+ Β· NumPy Β· Matplotlib Β· Gradio Β· Anthropic API
## License
MIT
|