Spaces:
Sleeping
Sleeping
Commit ·
8fb4252
1
Parent(s): b5587c0
docs: add README.md with project overview, environment specifications, and API documentation
Browse files
README.md
CHANGED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: DataEngEnv
|
| 3 |
+
emoji: 🔧
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: true
|
| 8 |
+
license: mit
|
| 9 |
+
tags:
|
| 10 |
+
- openenv
|
| 11 |
+
- ml
|
| 12 |
+
- data-engineering
|
| 13 |
+
- debugging
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
## 1. What is DataEngEnv
|
| 17 |
+
DataEngEnv is an interactive ML Data Pipeline Debugger designed to test AI agents against realistic, broken machine learning pipelines. Agents act as automated data engineers, tasked with identifying and fixing issues like critical logical data leakage, dirty missing values, and misaligned schemas before the code hits production.
|
| 18 |
+
|
| 19 |
+
## 2. Observation Space
|
| 20 |
+
| Field | Type | Description |
|
| 21 |
+
|---|---|---|
|
| 22 |
+
| `task_id` | `int` | The identifier for the current task sequence. |
|
| 23 |
+
| `step_number` | `int` | Current sequence iteration limit bound to 20 maximum. |
|
| 24 |
+
| `script_content` | `str` | The actual python string content of the ML pipeline being worked on. |
|
| 25 |
+
| `last_run_output` | `str` | Terminal STDOUT resulting from the last `run_script` action. |
|
| 26 |
+
| `last_run_error` | `str \| null` | Terminal STDERR if the pipeline threw an exception or timeout. |
|
| 27 |
+
| `data_preview` | `str` | A printed visualization dump of `.describe()` and `.head()`. |
|
| 28 |
+
| `schema_info` | `dict` | A mapping dictionary of column names and respective `dtypes`. |
|
| 29 |
+
| `done` | `bool` | True if the agent has submitted its fix or ran out of steps. |
|
| 30 |
+
|
| 31 |
+
## 3. Action Space
|
| 32 |
+
| Action Type | Payload Format | Description |
|
| 33 |
+
|---|---|---|
|
| 34 |
+
| `inspect_data` | `{}` | Requests `data_preview` of current dataset statistics. |
|
| 35 |
+
| `check_schema` | `{}` | Requests current pandas dataframe schema properties. |
|
| 36 |
+
| `run_script` | `{}` | Executes the script in a 10s timeout protected sandbox. |
|
| 37 |
+
| `edit_script` | `{"old": str, "new": str}` | Simple string patching to correct pipeline code. |
|
| 38 |
+
| `submit` | `{}` | Submits script to grading suite finalizing the episode. |
|
| 39 |
+
|
| 40 |
+
## 4. The 3 Tasks
|
| 41 |
+
1. **column_rename_bug (Easy)**: The agent must fix a CSV loading script schema bug by identifying and renaming the string target `age_years` back to `age`.
|
| 42 |
+
2. **dirty_data (Medium)**: The agent has to handle real-world missing values and extreme numeric outliers by properly leveraging `dropna`/`fillna` and `clip`/`quantile` constraints.
|
| 43 |
+
3. **data_leakage (Hard)**: The agent must fix critical logical target leakage where the predictive `scaler.fit()` was erroneously processed *before* `train_test_split()`, resulting in test set snooping.
|
| 44 |
+
|
| 45 |
+
## 5. Reward Function
|
| 46 |
+
DataEngEnv operates on a tiered `0.0 to 1.0` reward curve designed to encourage strong Data Engineering practices.
|
| 47 |
+
A maximum `1.0` score is only achieved on sequence completion, evaluated against hidden test suites, provided the final script compiles perfectly. However, partial step rewards (e.g. `+0.1` or `+0.2`) are iteratively granted via the `RewardEngine` across each step if the agent dynamically uses `inspect_data` or correctly patches missing `nan` strings before submitting, incentivizing exploratory debugging habits. Submissions with zero exploration or logic modifications receive explicit score deductions (`-0.2`).
|
| 48 |
+
|
| 49 |
+
## 6. Setup
|
| 50 |
+
**Standard Local Setup:**
|
| 51 |
+
```bash
|
| 52 |
+
python -m venv venv
|
| 53 |
+
source venv/bin/activate
|
| 54 |
+
pip install -r requirements.txt
|
| 55 |
+
uvicorn app.main:app
|
| 56 |
+
```
|
| 57 |
+
**Docker Build Deployment:**
|
| 58 |
+
```bash
|
| 59 |
+
docker build -t dataengenv .
|
| 60 |
+
docker run -p 7860:7860 dataengenv
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## 7. API Reference
|
| 64 |
+
### Current Endpoint Specs
|
| 65 |
+
- **POST `/reset`**
|
| 66 |
+
```bash
|
| 67 |
+
curl -X POST http://localhost:7860/reset \
|
| 68 |
+
-H "Content-Type: application/json" -d '{"task_id": 1}'
|
| 69 |
+
```
|
| 70 |
+
- **POST `/step`**
|
| 71 |
+
```bash
|
| 72 |
+
curl -X POST http://localhost:7860/step \
|
| 73 |
+
-H "Content-Type: application/json" -d '{"action_type": "inspect_data", "payload": {}}'
|
| 74 |
+
```
|
| 75 |
+
- **GET `/state`**
|
| 76 |
+
```bash
|
| 77 |
+
curl http://localhost:7860/state
|
| 78 |
+
```
|
| 79 |
+
- **GET `/tasks`**
|
| 80 |
+
```bash
|
| 81 |
+
curl http://localhost:7860/tasks
|
| 82 |
+
```
|
| 83 |
+
- **POST `/grader`**
|
| 84 |
+
```bash
|
| 85 |
+
curl -X POST http://localhost:7860/grader \
|
| 86 |
+
-H "Content-Type: application/json" -d '{"task_id": 1}'
|
| 87 |
+
```
|
| 88 |
+
- **GET `/baseline`**
|
| 89 |
+
```bash
|
| 90 |
+
curl http://localhost:7860/baseline
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
## 8. Baseline Scores
|
| 94 |
+
*Evaluated using `llama-3.1-8b-instant` via Groq*
|
| 95 |
+
|
| 96 |
+
| Task | Run Status | Score | Steps |
|
| 97 |
+
|---|---|---|---|
|
| 98 |
+
| Task 1 (Easy) | Exhausted Steps | 0.00 | 15 |
|
| 99 |
+
| Task 2 (Medium) | Exhausted Steps | 0.00 | 15 |
|
| 100 |
+
| Task 3 (Hard) | Partial Credit | 0.75 | 15 |
|
| 101 |
+
| **Global Average** | | **0.25** | |
|
| 102 |
+
|
| 103 |
+
## 9. Team
|
| 104 |
+
Ctrl Alt Hacks — Pranav | Meta AI × Hugging Face OpenEnv Challenge
|