From 54071575fb9a91fe9cd3d30105ae9f3a2cc24c1b Mon Sep 17 00:00:00 2001 From: wenbang24 Date: Fri, 16 Aug 2024 10:57:47 +1000 Subject: [PATCH] removed comments --- pysr/regressor_sequence.py | 19 ------------------- pysr/test/test.py | 14 +++++++------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/pysr/regressor_sequence.py b/pysr/regressor_sequence.py index c3bf71ae..63e253c1 100644 --- a/pysr/regressor_sequence.py +++ b/pysr/regressor_sequence.py @@ -216,25 +216,6 @@ def predict(self, X, index=None, num_predictions=1): ) return pred - """ historical_X = self._sliding_window(X)[:: X.shape[1], :] - pred = self._regressor.predict(X=historical_X, index=index) - if extra_predictions > 0: - output = pred - previous_points = historical_X[-1] - # Without this, the model will re-predict the last data point - pred_once = self._regressor.predict(X=[previous_points], index=index) - previous_points = previous_points[X.shape[1] :] - previous_points = np.append(previous_points, pred_once) - previous_points = previous_points.flatten() - for _ in range(extra_predictions): - pred_once = self._regressor.predict(X=[previous_points], index=index) - previous_points = previous_points[X.shape[1] :] - previous_points = np.append(previous_points, pred_once) - previous_points = previous_points.flatten() - output = np.append(output, pred_once) - return output.reshape(-1, X.shape[1]) - return pred """ - def _sliding_window(self, X): return np.lib.stride_tricks.sliding_window_view( X.flatten(), self.recursive_history_length * np.prod(X.shape[1]) diff --git a/pysr/test/test.py b/pysr/test/test.py index 49cc4689..46e39362 100644 --- a/pysr/test/test.py +++ b/pysr/test/test.py @@ -1575,14 +1575,14 @@ def test_unit_propagation(self): def runtests(just_tests=False): """Run all tests in test.py.""" test_cases = [ - # TestPipeline, + TestPipeline, TestSequenceRegressor, - # TestBest, - # TestFeatureSelection, - # TestMiscellaneous, - # TestHelpMessages, - # TestLaTeXTable, - # TestDimensionalConstraints, + TestBest, + TestFeatureSelection, + TestMiscellaneous, + TestHelpMessages, + TestLaTeXTable, + TestDimensionalConstraints, ] if just_tests: return test_cases