MilesCranmer commited on
Commit
af8ab17
1 Parent(s): 15105ad

Add warning about setting random state without deterministic

Browse files
Files changed (1) hide show
  1. pysr/sr.py +7 -0
pysr/sr.py CHANGED
@@ -976,6 +976,13 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
976
  "`multithreading` to `False` or `None`, and `procs` to `0`."
977
  )
978
 
 
 
 
 
 
 
 
979
  # NotImplementedError - Values that could be supported at a later time
980
  if self.optimizer_algorithm not in VALID_OPTIMIZER_ALGORITHMS:
981
  raise NotImplementedError(
 
976
  "`multithreading` to `False` or `None`, and `procs` to `0`."
977
  )
978
 
979
+ if self.random_state != None and (not self.deterministic or self.procs != 0):
980
+ warnings.warn(
981
+ "Note: Setting `random_state` without also setting `deterministic` "
982
+ "to True and `procs` to 0 "
983
+ "will result in non-deterministic searches. "
984
+ )
985
+
986
  # NotImplementedError - Values that could be supported at a later time
987
  if self.optimizer_algorithm not in VALID_OPTIMIZER_ALGORITHMS:
988
  raise NotImplementedError(