lawsynth/crates/lawsynth-sparse
caelum0x 7a06febeb6 chore(release): inherit repository metadata on all crates
Crates inherited version/license/edition from [workspace.package] but not
`repository`, so every crate published without a repository link. Add
`repository.workspace = true` uniformly, completing the
description+version+license+repository metadata `cargo publish` and crates.io
expect. No build impact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 13:08:47 +03:00
..
2026-08-16 21:04:23 +03:00
2026-08-16 21:04:23 +03:00
2026-08-16 21:04:23 +03:00

lawsynth-sparse

Deterministic sparse-regression solvers for fitting candidate equation terms. The crate accepts a validated dense RegressionProblem and offers STLSQ, SR3, coordinate-descent LASSO, grouped thresholding, non-negative least squares, feature scaling, and deterministic bootstrap stability selection.

Use

use lawsynth_sparse::{RegressionProblem, SparseConfig, stlsq};

let problem = RegressionProblem::new(vec![vec![1.0], vec![2.0], vec![3.0]], vec![2.0, 4.0, 6.0])?;
let solution = stlsq(&problem, &SparseConfig::default())?;
assert_eq!(solution.coefficients.len(), 1);
# Ok::<(), lawsynth_sparse::SparseError>(())

Rows are observations and columns are features. Solvers reject ragged or non-finite inputs. Sparse selection is a model-selection mechanism, not proof that excluded terms have no physical or causal effect.