Skip to content

Add PIR (Physics Intermediate Representation) method#202

Open
Qazi-pk wants to merge 1 commit into
cavalab:devfrom
Qazi-pk:add-pir-method
Open

Add PIR (Physics Intermediate Representation) method#202
Qazi-pk wants to merge 1 commit into
cavalab:devfrom
Qazi-pk:add-pir-method

Conversation

@Qazi-pk
Copy link
Copy Markdown

@Qazi-pk Qazi-pk commented May 29, 2026

Method: PIR (Physics Intermediate Representation)

A torch-free symbolic regression method combining dimensional analysis,
RANSAC consensus filtering, residual refinement, and sparse coefficient
selection. Sklearn-compatible.

Files added

  • experiment/methods/PIRRegressor.py — exports est, hyper_params,
    complexity(est), model(est, X)
  • experiment/methods/src/PIR_install.sh — pip-installs physics-engine@v0.1.0
    from the public source repo (no source code vendored in this PR)

Configuration

Blind-sweep settings (SEED=0):
enforce_dimensions=False, allowed_powers=[1, 2],
include_pairwise_products=True, use_ransac=True, use_residual=True,
use_sparse=True, use_ot_loss=False, add_physics_features=False.
Other parameters at defaults.

Honest scope

Blind Tier A (Feynman, SRBench-compatible protocol, 5 seeds):
7/44 solved (≈7.6 mean) under the configuration above. An earlier
27.3% figure in the project's own notes was formula-peeking and is not
the blind result.

The current classical engine is architecturally limited to ≤ 2-variable
monomial structures (pairwise structure detector); extension to ≥ 3-variable
laws is future work and not part of this PR.

Open question for reviewers

model(est, X) returns a sympy-parseable string using the column names of
the input pd.DataFrame X. If SRBench's symbolic-equivalence check
expects a specific naming convention (e.g. x_0..x_m vs Feynman's q1,
Ef, …), please flag — happy to adjust the variable mapping in
model() to match.

Checklist

  • Targets dev branch
  • Sklearn-compatible API (fit, predict, random_state)
  • No source code vendored; install.sh pulls from stable tag
  • model(est, X) returns a sympy-compatible string
  • MIT licensed

Symbolic regression with dimensional analysis, RANSAC consensus,
residual refinement, and sparse coefficient selection. Torch-free.

- experiment/methods/PIRRegressor.py: sklearn-compatible estimator
  with est, hyper_params, complexity(est), model(est, X)
- experiment/methods/src/PIR_install.sh: installs physics-engine@v0.1.0

Engine: https://github.com/Qazi-pk/physics-engine (MIT, v0.1.0, commit 736a89c)
@Qazi-pk
Copy link
Copy Markdown
Author

Qazi-pk commented May 29, 2026

CI is failing in Set up job with actions/cache@v2 deprecated — this appears to be an upstream workflow issue, not specific to this PR (no project files are reached before the failure).

Happy to wait while it's addressed, or to open a small follow-up PR bumping the cache action version if that would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant