Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Eden Wu committed Aug 2, 2024
1 parent fea9fc6 commit f7fc5bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions alpha_automl/automl_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ def fit(self, X, y):
X_sample, y_sample, _ = sample_dataset(self.X, self.y, 10000, self.task_type)
optimizer = SmacOptimizer(X=X_sample, y=y_sample, splitter=self.splitter, scorer=self.scorer, n_trials=200)

for index, pipeline in enumerate(sorted_pipelines, start=1):
pipeline_id = PIPELINE_PREFIX + str(index)
for index, pipeline in enumerate(sorted_pipelines):
pipeline_id = PIPELINE_PREFIX + str(index+1)
self.pipelines[pipeline_id] = pipeline
# [SMAC] added here!!
if self.optimizing and index <= 10:
if self.optimizing and index < 10:
opt_pipeline = optimizer.optimize_pipeline(pipeline.get_pipeline())
smac_pipeline = score_pipeline(opt_pipeline, X_sample, y_sample, self.scorer, self.splitter, self.task_type)
if smac_pipeline.get_score() > pipeline.get_score():
Expand Down

0 comments on commit f7fc5bf

Please sign in to comment.