зеркало из https://github.com/microsoft/FLAML.git
fix: LinearSVC results now reproducible (#1376)
Co-authored-by: Daniel Grindrod <Daniel.Grindrod@evotec.com>
This commit is contained in:
Родитель
72881d3a2b
Коммит
a316f84fe1
|
@ -2185,6 +2185,11 @@ class SVCEstimator(SKLearnEstimator):
|
||||||
|
|
||||||
def __init__(self, task="binary", **config):
|
def __init__(self, task="binary", **config):
|
||||||
super().__init__(task, **config)
|
super().__init__(task, **config)
|
||||||
|
self.params.update(
|
||||||
|
{
|
||||||
|
"random_state": config.get("random_seed", 10242048),
|
||||||
|
}
|
||||||
|
)
|
||||||
assert self._task.is_classification(), "LinearSVC for classification task only"
|
assert self._task.is_classification(), "LinearSVC for classification task only"
|
||||||
self.estimator_class = LinearSVC
|
self.estimator_class = LinearSVC
|
||||||
|
|
||||||
|
|
|
@ -435,6 +435,7 @@ class TestClassification(unittest.TestCase):
|
||||||
# "lrl1",
|
# "lrl1",
|
||||||
"lrl2",
|
"lrl2",
|
||||||
"rf",
|
"rf",
|
||||||
|
"svc",
|
||||||
"xgboost",
|
"xgboost",
|
||||||
"xgb_limitdepth",
|
"xgb_limitdepth",
|
||||||
],
|
],
|
||||||
|
@ -495,6 +496,7 @@ def test_reproducibility_of_classification_models(estimator: str):
|
||||||
# "lgbm",
|
# "lgbm",
|
||||||
# "lrl1",
|
# "lrl1",
|
||||||
"lrl2",
|
"lrl2",
|
||||||
|
"svc",
|
||||||
"rf",
|
"rf",
|
||||||
"xgboost",
|
"xgboost",
|
||||||
"xgb_limitdepth",
|
"xgb_limitdepth",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче