From 5ccd427a93bb0a79015a88b2c9443606c76ff619 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Mon, 24 Feb 2025 19:59:56 +0000 Subject: [PATCH] chore: remove warning about many features --- pysr/sr.py | 10 ---------- pysr/test/test_main.py | 11 ----------- 2 files changed, 21 deletions(-) diff --git a/pysr/sr.py b/pysr/sr.py index 94994ea2..12b44ec8 100644 --- a/pysr/sr.py +++ b/pysr/sr.py @@ -2263,16 +2263,6 @@ def fit( ) ) - # Warn about large feature counts (still warn if feature count is large - # after running feature selection) - if self.n_features_in_ >= 10: - warnings.warn( - "Note: you are running with 10 features or more. " - "Genetic algorithms like used in PySR scale poorly with large numbers of features. " - "You should run PySR for more `niterations` to ensure it can find " - "the correct variables, and consider using a larger `maxsize`." - ) - # Assertion checks use_custom_variable_names = variable_names is not None # TODO: this is always true. diff --git a/pysr/test/test_main.py b/pysr/test/test_main.py index cb400846..9b22ae2b 100644 --- a/pysr/test/test_main.py +++ b/pysr/test/test_main.py @@ -1045,17 +1045,6 @@ def test_size_warning(self): model.fit(X, y) self.assertIn("more than 10,000", str(context.exception)) - def test_feature_warning(self): - """Ensure that a warning is given for large number of features.""" - model = PySRRegressor() - X = np.random.randn(100, 10) - y = np.random.randn(100) - with warnings.catch_warnings(): - warnings.simplefilter("error") - with self.assertRaises(Exception) as context: - model.fit(X, y) - self.assertIn("with 10 features or more", str(context.exception)) - def test_deterministic_warnings(self): """Ensure that warnings are given for determinism""" model = PySRRegressor(random_state=0)