Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
494a3ba
1
Parent(s):
045bdb1
Correct ordering of init parameters
Browse files- pysr/sr.py +14 -14
pysr/sr.py
CHANGED
@@ -220,12 +220,11 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
220 |
this number.
|
221 |
|
222 |
maxsize : int, default=20
|
223 |
-
Max
|
224 |
|
225 |
maxdepth : int, default=None
|
226 |
Max depth of an equation. You can use both :param`maxsize` and
|
227 |
-
:param`maxdepth`. :param`maxdepth` is by default
|
228 |
-
:param`maxsize`, which means that it is redundant.
|
229 |
|
230 |
warmup_maxsize_by : float, default=0.0
|
231 |
Whether to slowly increase max size from a small number up to
|
@@ -240,8 +239,8 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
240 |
Dictionary of int (unary) or 2-tuples (binary), this enforces
|
241 |
maxsize constraints on the individual arguments of operators.
|
242 |
E.g., `'pow': (-1, 1)` says that power laws can have any
|
243 |
-
complexity left argument, but only 1 complexity
|
244 |
-
this to force more interpretable solutions.
|
245 |
|
246 |
nested_constraints : dict[str, dict], default=None
|
247 |
Specifies how many times a combination of operators can be
|
@@ -683,31 +682,30 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
683 |
self.unary_operators = unary_operators
|
684 |
self.niterations = niterations
|
685 |
self.populations = populations
|
686 |
-
# - Model search Constraints
|
687 |
self.population_size = population_size
|
688 |
-
self.
|
|
|
689 |
self.maxsize = maxsize
|
690 |
self.maxdepth = maxdepth
|
691 |
-
self.warmup_maxsize_by = warmup_maxsize_by
|
692 |
-
self.timeout_in_seconds = timeout_in_seconds
|
693 |
self.constraints = constraints
|
694 |
self.nested_constraints = nested_constraints
|
|
|
|
|
|
|
|
|
|
|
695 |
# - Loss parameters
|
696 |
self.loss = loss
|
697 |
self.complexity_of_operators = complexity_of_operators
|
698 |
self.complexity_of_constants = complexity_of_constants
|
699 |
self.complexity_of_variables = complexity_of_variables
|
700 |
-
self.parsimony =
|
701 |
self.use_frequency = use_frequency
|
702 |
self.use_frequency_in_tournament = use_frequency_in_tournament
|
703 |
self.alpha = alpha
|
704 |
self.annealing = annealing
|
705 |
-
self.early_stop_condition = early_stop_condition
|
706 |
# - Evolutionary search parameters
|
707 |
# -- Mutation parameters
|
708 |
-
self.ncyclesperiteration = ncyclesperiteration
|
709 |
-
self.fraction_replaced = fraction_replaced
|
710 |
-
self.fraction_replaced_hof = fraction_replaced_hof
|
711 |
self.weight_add_node = weight_add_node
|
712 |
self.weight_insert_node = weight_insert_node
|
713 |
self.weight_delete_node = weight_delete_node
|
@@ -721,6 +719,8 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
721 |
# -- Migration parameters
|
722 |
self.migration = migration
|
723 |
self.hof_migration = hof_migration
|
|
|
|
|
724 |
self.topn = topn
|
725 |
# -- Constants parameters
|
726 |
self.should_optimize_constants = should_optimize_constants
|
|
|
220 |
this number.
|
221 |
|
222 |
maxsize : int, default=20
|
223 |
+
Max complexity of an equation.
|
224 |
|
225 |
maxdepth : int, default=None
|
226 |
Max depth of an equation. You can use both :param`maxsize` and
|
227 |
+
:param`maxdepth`. :param`maxdepth` is by default not used.
|
|
|
228 |
|
229 |
warmup_maxsize_by : float, default=0.0
|
230 |
Whether to slowly increase max size from a small number up to
|
|
|
239 |
Dictionary of int (unary) or 2-tuples (binary), this enforces
|
240 |
maxsize constraints on the individual arguments of operators.
|
241 |
E.g., `'pow': (-1, 1)` says that power laws can have any
|
242 |
+
complexity left argument, but only 1 complexity in the right
|
243 |
+
argument. Use this to force more interpretable solutions.
|
244 |
|
245 |
nested_constraints : dict[str, dict], default=None
|
246 |
Specifies how many times a combination of operators can be
|
|
|
682 |
self.unary_operators = unary_operators
|
683 |
self.niterations = niterations
|
684 |
self.populations = populations
|
|
|
685 |
self.population_size = population_size
|
686 |
+
self.ncyclesperiteration = ncyclesperiteration
|
687 |
+
# - Equation Constraints
|
688 |
self.maxsize = maxsize
|
689 |
self.maxdepth = maxdepth
|
|
|
|
|
690 |
self.constraints = constraints
|
691 |
self.nested_constraints = nested_constraints
|
692 |
+
self.warmup_maxsize_by = warmup_maxsize_by
|
693 |
+
# - Early exit conditions:
|
694 |
+
self.max_evals = max_evals
|
695 |
+
self.timeout_in_seconds = timeout_in_seconds
|
696 |
+
self.early_stop_condition = early_stop_condition
|
697 |
# - Loss parameters
|
698 |
self.loss = loss
|
699 |
self.complexity_of_operators = complexity_of_operators
|
700 |
self.complexity_of_constants = complexity_of_constants
|
701 |
self.complexity_of_variables = complexity_of_variables
|
702 |
+
self.parsimony = parsimony
|
703 |
self.use_frequency = use_frequency
|
704 |
self.use_frequency_in_tournament = use_frequency_in_tournament
|
705 |
self.alpha = alpha
|
706 |
self.annealing = annealing
|
|
|
707 |
# - Evolutionary search parameters
|
708 |
# -- Mutation parameters
|
|
|
|
|
|
|
709 |
self.weight_add_node = weight_add_node
|
710 |
self.weight_insert_node = weight_insert_node
|
711 |
self.weight_delete_node = weight_delete_node
|
|
|
719 |
# -- Migration parameters
|
720 |
self.migration = migration
|
721 |
self.hof_migration = hof_migration
|
722 |
+
self.fraction_replaced = fraction_replaced
|
723 |
+
self.fraction_replaced_hof = fraction_replaced_hof
|
724 |
self.topn = topn
|
725 |
# -- Constants parameters
|
726 |
self.should_optimize_constants = should_optimize_constants
|