Metadata-Version: 2.4
Name: symbolic-data
Version: 0.1.0
Summary: Model-agnostic symbolic-regression data layer: skeleton/expression sampling, priors, holdout, datasets.
Author: Paul Saegert
License-Expression: MIT
Project-URL: Homepage, https://github.com/psaegert/symbolic-data
Project-URL: Repository, https://github.com/psaegert/symbolic-data
Keywords: symbolic-regression,dataset,sampling,holdout,expression
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scikit-learn
Requires-Dist: simplipy>=0.3.1
Requires-Dist: pyyaml
Requires-Dist: tqdm
Requires-Dist: huggingface_hub
Provides-Extra: sympy
Requires-Dist: sympy; extra == "sympy"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: license-file

# symbolic_data

The model-agnostic symbolic-regression **data layer**, carved out of
[flash-ansr](https://github.com/psaegert/flash-ansr): skeleton/expression sampling,
priors, `(X, y)` support sampling, holdout management, and dataset construction.

Both symbolic-regression methods (for training holdout) and the
[srbf](https://github.com/psaegert/srbf) eval framework depend on it, so training,
holdout, and evaluation draw from one source of truth. Depends only on
[`simplipy`](https://github.com/psaegert/simplipy) + numpy/sklearn.

## Install

```bash
pip install symbolic-data
```

## Quick start

```python
import symbolic_data

# 1. Sample (X, y) problems from a skeleton pool (the model-agnostic seam)
pool = symbolic_data.SkeletonPool.from_config("skeleton_pool.yaml")
pool.create(100)
for sample in symbolic_data.iter_samples(pool, n_support=32, noise_level=0.01, seed=0):
    sample.x_support, sample.y_support, sample.expression  # ready to fit / tokenize

# 2. Load a benchmark (spec fetched + cached from the psaegert/ansr-data HF dataset)
fastsrb = symbolic_data.load_benchmark("fastsrb")
dataset = fastsrb.sample("II.38.3", n_points=100)
```

## Extensibility

Distributions and benchmarks are pluggable via registries: in-process with
`@symbolic_data.DISTRIBUTIONS.register("name")` / `@symbolic_data.BENCHMARKS.register("name")`, or
across packages via `importlib.metadata` entry points (groups `symbolic_data.distributions`,
`symbolic_data.benchmarks`). A registered name drops into the same config slot as a builtin.

## Versioning / reproducibility

v1 guarantees **leak-safety** (a seeded, shipped holdout grid + a robust symbolic/numeric
matcher), not cross-consumer byte-identical regeneration (the rng-Generator threading is a
separate, later phase). Benchmark specs are HF-versioned and stamped on `.provenance`.

> Status: v0.1.0. Registry, `iter_samples` seam, and `load_benchmark` (FastSRB) are in.
> Deferred: the MIA matched-control audit, curated benchmark loaders (Feynman/Nguyen), the
> canonical-v1 holdout grid mint, and cross-consumer byte-identical sampling.
