Skip to main content

beamfeat

CI Tests PyPI Python License: MIT TMLR DOI Docs

beamfeat builds readable formulas from the columns of a table, such as (x0 / x2) * x1 or log(a) * log(b), tests each against the null hypothesis that it is independent of the target, and keeps only those whose null is rejected, with a stated false-discovery-rate guarantee. The result is a short equation in your own column names, from a scikit-learn estimator you can fit, inspect and predict with. The method is described in a TMLR 2026 paper.

An example: fat content from a spectrum

Held-out R² on tecator over five splits: beamfeat 0.991 from three or four formulas; ridge 0.957, LightGBM 0.756 and random forest 0.717 on all 100 channels

In the tecator data, the task is to predict the fat content of meat samples from 100 near-infrared absorbance channels. Over five random 75/25 splits, beamfeat's equation uses three or four formulas, mostly ratios of channel differences such as ((x35 - x42) / (x37 - x39)), and reaches a mean held-out R² of 0.991. On all 100 channels, ridge regression reaches 0.957, a random forest 0.717 and LightGBM 0.756. A random forest given the formulas in place of the raw channels goes from 0.739 to 0.992, on three of the five splits.

The accuracy is stable from split to split; which ratios are picked is not. Neighbouring channels correlate at 0.99988, so many ratios are nearly interchangeable, and each split settles on its own. stability_report measures this on any data: it refits on many random splits and counts the distinct equations.

The numbers are the paper's (Table 6 and its appendices), from the archived run in benchmarks/additional_experiments/; benchmarks/figures/tecator.py draws the plot. The Benchmarks page has all nine datasets of that study, including those where beamfeat trails.

Install

pip install beamfeat              # core: numpy, scikit-learn, joblib
pip install "beamfeat[units]"     # + pint, for units
pip install "beamfeat[display]"   # + sympy, for to_sympy() and latex()
pip install "beamfeat[all]"       # + both, pandas and the test dependencies

Python 3.10 or newer, with no upper version pins: the 965 tests pass on Python 3.10 to 3.15 with the newest releases each supports, and the suite runs on the oldest supported stack too. Installation lists the versions, and how to run the tests or reproduce the benchmarks.

It fits like any scikit-learn estimator:

from beamfeat import BeamFeatRegressor

model = BeamFeatRegressor().fit(X, y)

model.formulas()        # ['((x0 / x2) * x1)', ...]
model.equation()        # 'y = 0.9847*((x0 / x2) * x1) + ...'
model.fdr_controlled_   # True: the features carry the stated FDR guarantee
model.predict(X_new)

What you get

  • Readable formulas. formulas() lists the features, and equation() prints the fitted model in your column names.
  • The equation at every size. equations() lists one equation per number of terms, with the R² each term adds.
  • LaTeX and SymPy. latex() typesets the equation, and to_sympy() hands the features to SymPy, and from there to NumPy, JAX or PyTorch.
  • Units. Give the columns units, as strings such as "kg" or as pint quantities, and dimensionally invalid expressions are never built.
  • A guarantee code can check. fdr_controlled_ says whether the features carry the guarantee, and fdr_scope_ whether it covers the printed equation or the larger certified set the equation was drawn from.
  • Fitted constants. Expressions can carry one constant fitted inside them, such as exp(a*x) and 1/(x + a), which recovers laws like exp(-x^2/2) exactly. On by default; fitted_ops=() turns it off.
  • Hidden building blocks, opt in. magnitude_slots keeps a few beam places for parts whose size tracks the target's even when they do not correlate with it, such as x0 and x1 in y = x0*x1 with centred inputs.
  • Every column in a formula tested, opt in. input_test=True tests each column inside each formula, and drops a formula when the test fails to reject the null for one of its columns, such as x6 in (x0 * x1) / (x0 + x6).
  • Stability. stability_report refits on many splits and shows whether the equation is the only good one or one of many.

The guarantee

The search runs on half of the training rows. On the other half, each formula it returns is tested against the null hypothesis that it is independent of the target, with a permutation test and the Benjamini–Yekutieli correction. The formulas whose nulls are rejected are the certified set, and on average at most 10% of them are false discoveries (target_fdr). That is an average over repeated fits, not a promise about any one fit, and it covers the certified set, of which the printed equation is by default a compact subset. If no null is rejected, the model uses no formulas and warns. Statistical guarantees gives each procedure's assumptions and what was measured.

Documentation

Citing

If you use beamfeat, please cite the paper:

@article{
daramola2026symbolic,
title={Symbolic feature construction with false discovery rate control},
author={Olanrewaju M. Daramola},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2026},
url={https://openreview.net/forum?id=UibXoy4h3u},
note={}
}

The Zenodo DOIs archive the code, not the paper: 10.5281/zenodo.23417132 is 0.4.2, the version the paper describes, with the run records behind its results, and 10.5281/zenodo.21619567 collects every release. CITATION.cff has the same details in machine-readable form.

Later releases correct two of the paper's results, detailed on the Benchmarks page: a harness bug understated featuretools, and fixing a search bug takes the datasets where beamfeat leads both tree ensembles from five to four.

If you use the selection procedures, please also cite the underlying statistics: Benjamini & Hochberg (1995), Benjamini & Yekutieli (2001), Barber & Candès (2015), Candès et al. (2018), and Phipson & Smyth (2010).

License

MIT.

Metadata

Release files for beamfeat 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beamfeat 0.6.0
File Size Uploaded Provenance
beamfeat-0.6.0.tar.gz 568.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for beamfeat 0.6.0
File Interpreter ABI Platform
beamfeat-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 702.5 kB

Release files / beamfeat-0.6.0.tar.gz

Download URL beamfeat-0.6.0.tar.gz
Size 568.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a284b8589fd3ce661a13dea4d0cd0b10d16a153cc30a33be22764f1dcddec3a5
BLAKE2b-256 checksum
How to use checksums
a6865c2057bb518426a052ec59d907677ecd74f80d4881b6e8ed3147d87fda61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / beamfeat-0.6.0-py3-none-any.whl

Download URL beamfeat-0.6.0-py3-none-any.whl
Size 134.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eecc0bdfe16ede8d095e1862e85b15902728bcfb99fd47786b9451a099a55b4c
BLAKE2b-256 checksum
How to use checksums
c6b9a6392184d82f7e26d519da5264563092daffc04d8b8713fa5bb09c21e2ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for beamfeat 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for beamfeat-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page