Model-agnostic symbolic-regression data layer: Problem, versioned ProblemCatalog, and ProblemSource (curated sets / on-the-fly generation / fixed).
Project description
symbolic_data
The model-agnostic symbolic-regression data layer, carved out of
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 eval framework depend on it, so training,
holdout, and evaluation draw from one source of truth. Depends only on
simplipy + numpy/sklearn.
Install
pip install symbolic-data
Quick start
import symbolic_data
# 1. Load a curated catalog (level 1: expressions + their intrinsic per-variable sampling). The
# curated sets are Hugging Face artifacts (not bundled in the wheel): a bare `name` needs network
# on first use, then caches; pass an explicit local path for offline use. `load_catalog("name@version")`
# resolves a versioned catalog from the HF manifest, and `load_catalog("user/repo:name")` loads a
# third party's published catalog.
feynman = symbolic_data.load_catalog("feynman") # 100 equations (Udrescu & Tegmark 2020)
entry = feynman["I.6.2a"]
entry.prepared, entry.variables # expression + intrinsic per-variable sampling
# 2. Draw (X, y) Problems from a ProblemSource (level 2). Mode is inferred from the config:
# a catalog ref (set), a `generator` block (on-the-fly), or inline `problems` (fixed).
src = symbolic_data.ProblemSource({"catalog": "feynman",
"sampling": {"n_support": 32, "n_validation": 32, "noise": 0.01}})
for problem in src:
problem.x_support, problem.y_support, problem.y_support_noisy, problem.expression # fit / tokenize
# 3. Freeze for exact reproduction (no seeds): materialize() -> a fixed source that re-iterates
# byte-identical Problems, identical across models/runs.
frozen = src.materialize()
Extensibility
Distributions are pluggable via a registry: in-process with
@symbolic_data.DISTRIBUTIONS.register("name"), or across packages via an importlib.metadata
entry point in the symbolic_data.distributions group. A registered name drops into the same
{"name": ..., "kwargs": ...} config slot as a builtin (e.g. the fastsrb distribution).
Catalogs are extensible through the resolver: publish your own to a Hugging Face dataset repo
with a manifest.json, then symbolic_data.load_catalog("your-user/your-repo:name@version").
Versioning / reproducibility
Reproducibility comes from fixed data, not seeds: sampling draws from a threaded
numpy.random.Generator (entropy by default), and exact reproduction across runs/models is
obtained from a fixed (materialized) catalog rather than by re-seeding. Versioned catalogs resolve
from Hugging Face with a pinned revision and a sha256 integrity check. Catalogs are HF artifacts
(not bundled in the wheel since 0.8.0): a bare name needs network on first use, then caches; pass
an explicit local path for fully offline operation.
Status: 0.8.0. The full public stack:
Problem, the unified distribution framework (incl. thefastsrbdistribution), and theCatalogaProblemSourcesamples from -- either a declarativeProblemCatalog(+load_catalog+ the versioned HF resolver) or an on-the-flyGenerativeCatalog(LampleChartonCatalog: random unary-binary operator trees;build_catalogdispatches acatalog: {type: ...}config).ProblemSourceadds the usage policy (draw method, support/validation counts, noise, holdouts/filters,problems_per_expression, unbounded streaming,materialize()+to_catalog()for frozen, byte-reproducible catalogs). Generate-mode is fullyGenerator-driven (no globalnp.random). The skeleton/support/holdout machinery stays private (_generate); the public face isLampleChartonCatalog. Curated catalogs (FastSRB, Feynman, Nguyen) are published to the HF assets repo and resolved by name (not bundled in the wheel). CLI:symbolic-data materialize. Deferred: a frozen holdout grid; functional-equivalenceexclude(currently exact normalized-expression match).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file symbolic_data-0.9.2.tar.gz.
File metadata
- Download URL: symbolic_data-0.9.2.tar.gz
- Upload date:
- Size: 67.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f2a442614a17f5348fdf18cfd819d2b30b538cae898882dafadc60ec5041762
|
|
| MD5 |
29bc13e699c46a04b92f7300723b018f
|
|
| BLAKE2b-256 |
c964aadfd3153153aaee97738f3fcd68b6d3609605f2b8a2aa24657419d1ec90
|
Provenance
The following attestation bundles were made for symbolic_data-0.9.2.tar.gz:
Publisher:
publish.yaml on psaegert/symbolic-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
symbolic_data-0.9.2.tar.gz -
Subject digest:
1f2a442614a17f5348fdf18cfd819d2b30b538cae898882dafadc60ec5041762 - Sigstore transparency entry: 2032971970
- Sigstore integration time:
-
Permalink:
psaegert/symbolic-data@9188749453ec88c53ab6c5a1deb4bb21f7c95fb8 -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@9188749453ec88c53ab6c5a1deb4bb21f7c95fb8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file symbolic_data-0.9.2-py3-none-any.whl.
File metadata
- Download URL: symbolic_data-0.9.2-py3-none-any.whl
- Upload date:
- Size: 59.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c74c8449501745fe04d42f8b5e82ebcb2fc786c0805f258de5b3ee4a6b2d8492
|
|
| MD5 |
eb2916f7fa28a06a26db85a0bc56c6dd
|
|
| BLAKE2b-256 |
93b368bee3b404a9f87348760fd55d2e0c8b128a3408d3d0d92acae3fa397c57
|
Provenance
The following attestation bundles were made for symbolic_data-0.9.2-py3-none-any.whl:
Publisher:
publish.yaml on psaegert/symbolic-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
symbolic_data-0.9.2-py3-none-any.whl -
Subject digest:
c74c8449501745fe04d42f8b5e82ebcb2fc786c0805f258de5b3ee4a6b2d8492 - Sigstore transparency entry: 2032972077
- Sigstore integration time:
-
Permalink:
psaegert/symbolic-data@9188749453ec88c53ab6c5a1deb4bb21f7c95fb8 -
Branch / Tag:
refs/tags/v0.9.2 - Owner: https://github.com/psaegert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@9188749453ec88c53ab6c5a1deb4bb21f7c95fb8 -
Trigger Event:
release
-
Statement type: