diff --git a/flaml/automl/model.py b/flaml/automl/model.py index b74137cf6b..8ddb4b2501 100644 --- a/flaml/automl/model.py +++ b/flaml/automl/model.py @@ -2450,6 +2450,9 @@ def config2params(self, config: dict) -> dict: def __init__(self, task="binary", **config): super().__init__(task, **config) + random_seed = self.params.pop("random_seed", config.get("random_seed", 10242048)) + if "random_state" not in self.params: + self.params["random_state"] = random_seed if self._task.is_classification(): self.estimator_class = SGDClassifier elif self._task.is_regression(): diff --git a/test/automl/test_classification.py b/test/automl/test_classification.py index 4305e3bcff..1ee22094fc 100644 --- a/test/automl/test_classification.py +++ b/test/automl/test_classification.py @@ -435,6 +435,7 @@ def test_sparse_matrix_lr(self): # "lrl1", "lrl2", "rf", + "sgd", "svc", "xgboost", "xgb_limitdepth", diff --git a/test/automl/test_regression.py b/test/automl/test_regression.py index 2820099587..74c6111274 100644 --- a/test/automl/test_regression.py +++ b/test/automl/test_regression.py @@ -254,6 +254,7 @@ def test_multioutput(): "kneighbor", "lgbm", "rf", + "sgd", "xgboost", "xgb_limitdepth", ],