yashr2020/opendataclean
OpenDataClean ๐งน
A 100% Gymnasium-compatible RL Benchmark built for autonomous AI agents to learn and solve real-world tabular data cleaning tasks.
๐ Overview
OpenDataClean leverages procedurally generated corruptions on pandas DataFrames to challenge RL agents with infinite varieties of messy datasets. The environment exposes native Gymnasium vector observation spaces (Box) and discrete action spaces (MultiDiscrete), ensuring deep integration with libraries like Stable-Baselines3, alongside a robust FastAPI Session Server out-of-the-box for multi-agent tournament deployments.
๐ Features
- โ
Full OpenEnv Spec Compliance: Implements the official specification entirely, including Pydantic-typed data schemas in
models.py,step()/reset()/state()endpoints in the FastAPI app, agent-specific graders, and a deployedopenenv.yamlschema wrapper. - Gymnasium API: Inherits
gymnasium.Env, supports standardreset()and 5-tuplestep(action)mechanisms. - Procedural Generation: Every episode spawns dynamically generated tabular noise (missing cells, duplication, type mismatches, category noise, and formatting corruption) using consistent seeds.
- Dense Step Evaluator: Computes strict
[-0.10, +0.10]incremental mathematical rewards based directly on the positive delta your agent actions apply to the dataset. - RESTful Multi-Agent Server: Ready to deploy via Docker, supporting robust
/session/interactions where independent agents can connect and compete on identical parameterized seeded drops.
๐ The Tasks
The benchmark includes three modes testing various pipeline heuristics:
- Easy: Address missing numerical/categorical values (
mean/modeimputation) and purge exact duplicates automatically. - Medium: Heavily addresses schema typing: format mismatched
objecttypes back todatetime64, normalize chaotic string noise using heuristics, and type-cast corrupted numeric variables safely. - Hard: A multi-table relational schema benchmark. Resolve primary-key corruption, scrub missing rows across
customersandsalesdatasets, detect mathematical outlier artifacts natively, and ensure clean table merging.
โ๏ธ Action Space
The agent controls the environment using an explicit MultiDiscrete numeric action vector corresponding to:
drop_duplicatesdrop_missing_rowsfill_missing(strategy:mean|mode)cast_type(target:int|float|str)normalize_categorystandardize_dateremove_outliersselect_table(hard task)done(terminate sequence)
๐ก Deployment
Built instantly via Docker.
# Build the container locally
docker build -t opendataclean .
# Deploy the 0.0.0.0:8000 tournament API
docker run -p 8000:8000 opendatacleanIf making API requests directly, the core endpoints are:
POST /reset/{task}โ Initialize a clean episodePOST /step/{task}โ Submit unstructured JSON actions without native gymnasium dependenciesPOST /session/createโ Bind and host a deterministic seed for peer-agent testing
