Spaces:
Sleeping
Sleeping
tttc3
commited on
Commit
•
9750ff9
1
Parent(s):
8570a81
Passed check_dict_unchanged
Browse files- pysr/sr.py +4 -1
pysr/sr.py
CHANGED
@@ -894,6 +894,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
894 |
NotImplementedError
|
895 |
Raised when an invalid model selection strategy is provided.
|
896 |
"""
|
|
|
897 |
if self.equations_ is None:
|
898 |
raise ValueError("No equations have been generated yet.")
|
899 |
|
@@ -1544,7 +1545,9 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
1544 |
ValueError
|
1545 |
Raises if the `best_equation` cannot be evaluated.
|
1546 |
"""
|
1547 |
-
|
|
|
|
|
1548 |
best_equation = self.get_best(index=index)
|
1549 |
|
1550 |
# When X is an numpy array or a pandas dataframe with a RangeIndex,
|
|
|
894 |
NotImplementedError
|
895 |
Raised when an invalid model selection strategy is provided.
|
896 |
"""
|
897 |
+
check_is_fitted(self, attributes=["equations_"])
|
898 |
if self.equations_ is None:
|
899 |
raise ValueError("No equations have been generated yet.")
|
900 |
|
|
|
1545 |
ValueError
|
1546 |
Raises if the `best_equation` cannot be evaluated.
|
1547 |
"""
|
1548 |
+
check_is_fitted(
|
1549 |
+
self, attributes=["selection_mask_", "feature_names_in_", "nout_"]
|
1550 |
+
)
|
1551 |
best_equation = self.get_best(index=index)
|
1552 |
|
1553 |
# When X is an numpy array or a pandas dataframe with a RangeIndex,
|