Skip to content

Commit

Permalink
Merge branch 'master' into custom-objectives
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Mar 25, 2023
2 parents ff874cd + 5abd46e commit 24b8a6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/param_groupings.yml
Expand Up @@ -24,6 +24,7 @@
- use_frequency
- use_frequency_in_tournament
- adaptive_parsimony_scaling
- should_simplify
- Mutations:
- weight_add_node
- weight_insert_node
Expand Down
6 changes: 6 additions & 0 deletions pysr/sr.py
Expand Up @@ -456,6 +456,9 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
topn : int
How many top individuals migrate from each population.
Default is `12`.
should_simplify : bool
Whether to use algebraic simplification in the search. Note that only
a few simple rules are implemented. Default is `True`.
should_optimize_constants : bool
Whether to numerically optimize constants (Nelder-Mead/Newton)
at the end of each iteration. Default is `True`.
Expand Down Expand Up @@ -727,6 +730,7 @@ def __init__(
migration=True,
hof_migration=True,
topn=12,
should_simplify=None,
should_optimize_constants=True,
optimizer_algorithm="BFGS",
optimizer_nrestarts=2,
Expand Down Expand Up @@ -780,6 +784,7 @@ def __init__(
self.constraints = constraints
self.nested_constraints = nested_constraints
self.warmup_maxsize_by = warmup_maxsize_by
self.should_simplify = should_simplify
# - Early exit conditions:
self.max_evals = max_evals
self.timeout_in_seconds = timeout_in_seconds
Expand Down Expand Up @@ -1621,6 +1626,7 @@ def _run(self, X, y, mutated_params, weights, seed):
migration=self.migration,
hof_migration=self.hof_migration,
fraction_replaced_hof=self.fraction_replaced_hof,
should_simplify=self.should_simplify,
should_optimize_constants=self.should_optimize_constants,
warmup_maxsize_by=self.warmup_maxsize_by,
use_frequency=self.use_frequency,
Expand Down
2 changes: 1 addition & 1 deletion pysr/version.py
@@ -1,2 +1,2 @@
__version__ = "0.12.1"
__symbolic_regression_jl_version__ = "0.16.1"
__symbolic_regression_jl_version__ = "0.16.2"

0 comments on commit 24b8a6f

Please sign in to comment.