From e1f32b179869400a30513b7908c0b87796335712 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Tue, 13 Apr 2021 19:30:42 -0500 Subject: [PATCH] Add n_jobs to BenchmarkRunner.fit --- miplearn/benchmark.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miplearn/benchmark.py b/miplearn/benchmark.py index 559ed5d..da59a69 100644 --- a/miplearn/benchmark.py +++ b/miplearn/benchmark.py @@ -98,7 +98,7 @@ class BenchmarkRunner: os.makedirs(os.path.dirname(filename), exist_ok=True) self.results.to_csv(filename) - def fit(self, instances: List[Instance]) -> None: + def fit(self, instances: List[Instance], n_jobs: int = 1) -> None: """ Trains all solvers with the provided training instances. @@ -109,7 +109,7 @@ class BenchmarkRunner: """ for (solver_name, solver) in self.solvers.items(): logger.debug(f"Fitting {solver_name}...") - solver.fit(instances) + solver.fit(instances, n_jobs=n_jobs) def _silence_miplearn_logger(self) -> None: miplearn_logger = logging.getLogger("miplearn")