HeadlinesBriefing HeadlinesBriefing.com

Keplearn: Symbolic Regression in Seconds

Hacker News •
×

Keplearn is a deterministic symbolic regression engine written in Rust that recovers closed-form equations from tabular data. Named after Johannes Kepler, who deduced his laws of planetary motion from Tycho Brahe's observations, it finds compact laws relating measurement columns. Given a TSV or CSV, it outputs candidate equations as JSON, scoring them with r2 computed from the printed equation itself. The tool runs as a single binary with zero dependencies, resolving exact laws in milliseconds. Fitted constants snap to rationals and multiples of pi, e, and sqrt(2), each verified before retention.

Usage is straightforward: name the target column with --target and pipe data with a header row. The delimiter is inferred from the header. Output includes the recovered model, r2, and timing. Diagnostics go to stderr, keeping stdout clean as one JSON object.

The engine searches over invertible reductions applied to the target column, fitting affine monomials with exponents from log-linear regression. Candidates are ranked on a 25% holdout with MDL complexity penalty. The winning expression is simplified, refit for scale and offset, and re-scored.

Keplearn is part of SRBench, the standard symbolic regression benchmark. Binaries are available for macOS (universal), Windows, and Linux (fully static).

Source: Hacker News · Summarized by HeadlinesBriefing