Skip to main content

Model-agnostic symbolic-regression data layer: skeleton/expression sampling, priors, holdout, datasets.

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. 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. All three curated sets ship as package data (no download), vendored
#    from their canonical upstreams.
fastsrb = symbolic_data.load_benchmark("fastsrb")          # 120 equations (Martinek, viktmar/FastSRB)
feynman = symbolic_data.load_benchmark("feynman")          # 100 equations (Udrescu & Tegmark 2020)
nguyen = symbolic_data.load_benchmark("nguyen")            # 12 equations (Uy et al. 2011; DSO)
dataset = feynman.sample("I.6.2a", n_points=100, random_state=0)

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). Curated benchmark specs ship as package data, vendored from their canonical upstreams (tools/build_benchmark_specs.py), and stamp their source on .provenance.

Status: v0.3.0. Registry, iter_samples seam, the data-prep CLI, and curated load_benchmark loaders (FastSRB, Feynman, Nguyen) are in, each vendored from its canonical upstream. The Feynman/Nguyen specs are numerically verified against their source formulas (tools/build_benchmark_specs.py). Deferred: the MIA matched-control audit, the canonical-v1 holdout grid mint, and cross-consumer byte-identical sampling.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

symbolic_data-0.3.0.tar.gz (68.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

symbolic_data-0.3.0-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file symbolic_data-0.3.0.tar.gz.

File metadata

  • Download URL: symbolic_data-0.3.0.tar.gz
  • Upload date:
  • Size: 68.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for symbolic_data-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5484e1b65564a3461127a7e0a133e4c32b5099c8587628b7c42d72394f8a640b
MD5 9008d8b68ded7f08891fdcf0176a455e
BLAKE2b-256 4edbe20d933880a0bd6650719569328e079ca76a23f1350e1468b658d24fab04

See more details on using hashes here.

Provenance

The following attestation bundles were made for symbolic_data-0.3.0.tar.gz:

Publisher: publish.yaml on psaegert/symbolic-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file symbolic_data-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: symbolic_data-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 67.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for symbolic_data-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a8df5a36b87d0ca5e68a1737f550873e3438ca543b896278918607612480e49
MD5 4ff33c96823f12da8dcc96b845cb3cd6
BLAKE2b-256 2e794abcd1a2567ac069745484d692a33c3818e999bd4f267f84b5a2dbf8859d

See more details on using hashes here.

Provenance

The following attestation bundles were made for symbolic_data-0.3.0-py3-none-any.whl:

Publisher: publish.yaml on psaegert/symbolic-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page