Skip to content

Commit

Permalink
Grid Search fix for issue #58
Browse files Browse the repository at this point in the history
Fix for the final estimator being added to the wrong step in the pipeline when using grid search
  • Loading branch information
Nabeel committed Nov 5, 2019
1 parent 16def76 commit e568007
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e568007

Please sign in to comment.