MilesCranmer commited on
Commit
e667c51
1 Parent(s): b6ca787

Add feature to skip mutation failures

Browse files
Files changed (2) hide show
  1. pysr/sr.py +5 -0
  2. pysr/version.py +2 -2
pysr/sr.py CHANGED
@@ -412,6 +412,7 @@ class PySRRegressor(BaseEstimator, RegressorMixin):
412
  precision=32,
413
  multithreading=None,
414
  use_symbolic_utils=False,
 
415
  ):
416
  """Initialize settings for an equation search in PySR.
417
 
@@ -533,6 +534,8 @@ class PySRRegressor(BaseEstimator, RegressorMixin):
533
  :type precision: int
534
  :param use_symbolic_utils: Whether to use SymbolicUtils during simplification.
535
  :type use_symbolic_utils: bool
 
 
536
  :returns: Initialized model. Call `.fit(X, y)` to fit your data!
537
  :type: PySRRegressor
538
  """
@@ -662,6 +665,7 @@ class PySRRegressor(BaseEstimator, RegressorMixin):
662
  precision=precision,
663
  multithreading=multithreading,
664
  use_symbolic_utils=use_symbolic_utils,
 
665
  ),
666
  }
667
 
@@ -1162,6 +1166,7 @@ class PySRRegressor(BaseEstimator, RegressorMixin):
1162
  progress=self.params["progress"],
1163
  timeout_in_seconds=self.params["timeout_in_seconds"],
1164
  crossoverProbability=self.params["crossoverProbability"],
 
1165
  )
1166
 
1167
  np_dtype = {16: np.float16, 32: np.float32, 64: np.float64}[
 
412
  precision=32,
413
  multithreading=None,
414
  use_symbolic_utils=False,
415
+ skip_mutation_failures=True,
416
  ):
417
  """Initialize settings for an equation search in PySR.
418
 
 
534
  :type precision: int
535
  :param use_symbolic_utils: Whether to use SymbolicUtils during simplification.
536
  :type use_symbolic_utils: bool
537
+ :param skip_mutation_failures: Whether to skip mutation and crossover failures, rather than simply re-sampling the current member.
538
+ :type skip_mutation_failures: bool
539
  :returns: Initialized model. Call `.fit(X, y)` to fit your data!
540
  :type: PySRRegressor
541
  """
 
665
  precision=precision,
666
  multithreading=multithreading,
667
  use_symbolic_utils=use_symbolic_utils,
668
+ skip_mutation_failures=skip_mutation_failures,
669
  ),
670
  }
671
 
 
1166
  progress=self.params["progress"],
1167
  timeout_in_seconds=self.params["timeout_in_seconds"],
1168
  crossoverProbability=self.params["crossoverProbability"],
1169
+ skip_mutation_failures=self.params["skip_mutation_failures"],
1170
  )
1171
 
1172
  np_dtype = {16: np.float16, 32: np.float32, 64: np.float64}[
pysr/version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.7.7"
2
- __symbolic_regression_jl_version__ = "0.7.11"
 
1
+ __version__ = "0.7.8"
2
+ __symbolic_regression_jl_version__ = "0.7.12"