From cba097c93f3ac45e673799758f5888463052171f Mon Sep 17 00:00:00 2001 From: Pierre Guetschel Date: Tue, 11 Jul 2023 14:56:40 +0200 Subject: [PATCH 1/2] Only within session for now --- moabb/evaluations/base.py | 4 +--- moabb/evaluations/evaluations.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/moabb/evaluations/base.py b/moabb/evaluations/base.py index 38ea2bcd6..6785ca12c 100644 --- a/moabb/evaluations/base.py +++ b/moabb/evaluations/base.py @@ -160,9 +160,7 @@ def process(self, pipelines, param_grid=None): for dataset in self.datasets: log.info("Processing dataset: {}".format(dataset.code)) - results = self.evaluate(dataset, pipelines, param_grid) - for res in results: - self.push_result(res, pipelines) + _ = self.evaluate(dataset, pipelines, param_grid) return self.results.to_dataframe(pipelines=pipelines) diff --git a/moabb/evaluations/evaluations.py b/moabb/evaluations/evaluations.py index 3d8f94cab..42d73f380 100644 --- a/moabb/evaluations/evaluations.py +++ b/moabb/evaluations/evaluations.py @@ -33,7 +33,6 @@ except ImportError: _carbonfootprint = False - log = logging.getLogger(__name__) # Numpy ArrayLike is only available starting from Numpy 1.20 and Python 3.8 @@ -305,6 +304,7 @@ def _evaluate_subject(self, dataset, pipelines, param_grid, subject): if _carbonfootprint: res["carbon_emission"] = (1000 * emissions,) subject_results.append(res) + self.push_result(res, pipelines) return subject_results @@ -398,7 +398,7 @@ def _evaluate_learning_curve(self, dataset, pipelines): continue not_enough_data = False log.info( - f"Permutation: {perm_i+1}," + f"Permutation: {perm_i + 1}," f" Training samples: {len(subset_indices)}" ) From e3466d96fb410d169433f138ceef1be165b2de98 Mon Sep 17 00:00:00 2001 From: Pierre Guetschel Date: Tue, 11 Jul 2023 15:03:54 +0200 Subject: [PATCH 2/2] Only cross-session and cross-subject --- moabb/evaluations/evaluations.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/moabb/evaluations/evaluations.py b/moabb/evaluations/evaluations.py index 42d73f380..7150ea8e3 100644 --- a/moabb/evaluations/evaluations.py +++ b/moabb/evaluations/evaluations.py @@ -661,6 +661,8 @@ def process_subject(self, subject, param_grid, pipelines, dataset): res["carbon_emission"] = (1000 * (emissions + emissions_grid),) results.append(res) + self.push_result(res, pipelines) + return results def is_valid(self, dataset): @@ -859,6 +861,7 @@ def evaluate(self, dataset, pipelines, param_grid): res["carbon_emission"] = ( 1000 * (emissions + emissions_grid[name]), ) + self.push_result(res, pipelines) yield res def is_valid(self, dataset):