зеркало из 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):
|
||||
super().__init__(task, **config)
|
||||
self.params.update(
|
||||
{
|
||||
"random_state": config.get("random_seed", 10242048),
|
||||
}
|
||||
)
|
||||
assert self._task.is_classification(), "LinearSVC for classification task only"
|
||||
self.estimator_class = LinearSVC
|
||||
|
||||
|
|
|
@ -435,6 +435,7 @@ class TestClassification(unittest.TestCase):
|
|||
# "lrl1",
|
||||
"lrl2",
|
||||
"rf",
|
||||
"svc",
|
||||
"xgboost",
|
||||
"xgb_limitdepth",
|
||||
],
|
||||
|
@ -495,6 +496,7 @@ def test_reproducibility_of_classification_models(estimator: str):
|
|||
# "lgbm",
|
||||
# "lrl1",
|
||||
"lrl2",
|
||||
"svc",
|
||||
"rf",
|
||||
"xgboost",
|
||||
"xgb_limitdepth",
|
||||
|
|
Загрузка…
Ссылка в новой задаче