From e568007ef26d3954ffcd6fdae4167a01696f59d7 Mon Sep 17 00:00:00 2001 From: Nabeel Date: Wed, 6 Nov 2019 10:02:20 +1100 Subject: [PATCH] Grid Search fix for issue #58 Fix for the final estimator being added to the wrong step in the pipeline when using grid search --- core/_sklearn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/_sklearn.py b/core/_sklearn.py index d2cd364..e736b56 100644 --- a/core/_sklearn.py +++ b/core/_sklearn.py @@ -600,9 +600,9 @@ def fit(self): # Include dimensionality reduction in the pipeline steps pipe_steps.append(('reduction', reduction)) - self.model.estimation_step = 1 + self.model.estimation_step = 2 else: - self.model.estimation_step = 0 + self.model.estimation_step = 1 # If this is a Keras estimator, update the input shape and reshape the data if required if self.model.using_keras: @@ -635,6 +635,7 @@ def fit(self): # If lag_target is True, an additional feature will be created for each sample using the previous value of y reshape = Reshaper(first_layer_kwargs=self.model.first_layer_kwargs, logfile=self.logfile) pipe_steps.append(('reshape', reshape)) + self.model.estimation_step += self.model.estimation_step # Avoid tensorflow error for keras models # https://github.com/tensorflow/tensorflow/issues/14356