From 96ecd3f63e3c7c3bf456220728912dbd612360ed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 09:52:06 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/curation/train_manual_curation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/spikeinterface/curation/train_manual_curation.py b/src/spikeinterface/curation/train_manual_curation.py index c581aafd50..b687ccbf6a 100644 --- a/src/spikeinterface/curation/train_manual_curation.py +++ b/src/spikeinterface/curation/train_manual_curation.py @@ -278,12 +278,14 @@ def _train_and_evaluate(self, imputation_strategy, scaler, classifier, X_train, model, param_space = self.get_classifier_search_space(classifier.__class__.__name__) try: from skopt import BayesSearchCV + model = BayesSearchCV( model, param_space, cv=3, scoring="balanced_accuracy", n_iter=25, random_state=self.seed, n_jobs=-1 ) except: print("BayesSearchCV from scikit-optimize not available, using GridSearchCV") from sklearn.model_selection import HalvingGridSearchCV + model = HalvingGridSearchCV(model, param_space, cv=3, scoring="balanced_accuracy", n_jobs=-1) model.fit(X_train_scaled, y_train)