Skip to content

Commit

Permalink
Merge pull request #243 from weixuanfu2016/weixuan-contribution
Browse files Browse the repository at this point in the history
For issue #236
  • Loading branch information
rhiever authored Aug 29, 2016
2 parents a381392 + 89c19ac commit c0ae397
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tpot/tpot.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,13 @@ def pareto_eq(ind1, ind2):
for pipeline, pipeline_scores in zip(self.hof.items, reversed(self.hof.keys)):
if pipeline_scores.wvalues[1] > top_score:
self._optimized_pipeline = pipeline

self._fitted_pipeline = self._toolbox.compile(expr=self._optimized_pipeline)
if self._optimized_pipeline is None:
raise ValueError(('No pipeline has been optimized. '
'This could be because the data was not formatted properly,'
'Or because data for a regression problem was provided to the TPOT classifier pipelines. '
'Please check your data first.'))
else:
self._fitted_pipeline = self._toolbox.compile(expr=self._optimized_pipeline)
with warnings.catch_warnings():
warnings.simplefilter('ignore')
self._fitted_pipeline.fit(features, classes)
Expand Down

0 comments on commit c0ae397

Please sign in to comment.