Spaces:
Sleeping
Sleeping
Download env/models.py from gauravnetes/datacleaning-env: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/gauravnetes/datacleaning-env/resolve/main/env/models.py
- Command line
-
hf download hf://spaces/gauravnetes/datacleaning-env/env/models.py
-
curl -L -o models.py https://huggingface.co/spaces/gauravnetes/datacleaning-env/resolve/main/env/models.py
1.12 kB
| from pydantic import BaseModel | |
| from typing import Any, Dict, List, Optional | |
| class Observation(BaseModel): | |
| task: str | |
| shape: List[int] # [rows, cols] | |
| columns: List[str] | |
| dtypes: Dict[str, str] | |
| null_counts: Dict[str, int] | |
| sample_rows: List[Dict[str, Any]] # first 3 rows as dicts | |
| message: str # human-readable status | |
| reward: float = 0.0 | |
| done: bool = False | |
| class Action(BaseModel): | |
| operation: str # e.g. "fill_nulls", "submit" | |
| column: Optional[str] = None | |
| strategy: Optional[str] = None # mean / median / mode / constant | |
| value: Optional[Any] = None # for constant fill | |
| target_format: Optional[str] = None # for normalize_dates | |
| dtype: Optional[str] = None # for cast_column | |
| subset: Optional[List[str]] = None # for drop_duplicates | |
| keep: Optional[str] = "first" # for drop_duplicates | |
| class Reward(BaseModel): | |
| score: float # 0.0 – 1.0 cumulative task score | |
| delta: float # score gained this step | |
| done: bool | |
| message: str |