Skip to content

Add a top-level random_state for reproducible optimization #39

Description

@dantzert

delay_io_train defaults to optimization_method="bayesian", whose initial sampling points are drawn with unseeded np.random.uniform(...) (only the GPR itself uses random_state=42). Consequence: two runs on identical input yield different discovered models — there is no public random_state/seed kwarg (only subsample_seed, and that covers subsampling, not the optimizer's RNG, and is only wired into the in-flight changes).

This undermines reproducibility (a must for scientific/model-discovery software) and makes optimization-related tests inherently flaky.

Proposal:

  • Add a random_state kwarg to delay_io_train (and thread it to SINDY_delays_MI for subsampling when no subsample_seed is given) that seeds an np.random.default_rng/RandomState used by the bayesian initial sampling and by the scipy.optimize defaults (differential_evolution/dual_annealing already accept seed).

  • Document that results are reproducible given random_state.

  • Cost: Low.

  • Benefit: Medium (reproducible model discovery; stable CI). Complements the scikit-learn-style estimator work in follow scikit-learn or similar conventions #17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions