Add feature engineering step into `DefaultAlgorithm`
- 主要语言
- Python
- 星标
- 850
- 派生
- 96
- PR 合并指标
- 30 天内没有已合并 PR
描述
This issue tracks adding a step in `Fast` mode that adds feature engineering components to pipelines. This will be done before the feature selection step and will allow us to experiment with the interactions between FE and FS.
```
def next_batch(self):
"""Get the next batch of pipelines to evaluate
Returns:
list(PipelineBase): a list of instances of PipelineBase subclasses, ready to be trained and evaluated.
"""
if self._batch_number == 0:
next_batch = self._create_naive_pipelines()
next_batch = next_batch + self._create_naive_pipelines_with_raw_features()
elif self._batch_number == 1:
next_batch = self._create_naive_pipelines(use_features=True)
elif self._batch_number == 2:
if self.has_engineered_features: # detect through origin tag
continue
next_batch = self._create_naive_pipelines_with_fe()
elif self._batch_number == 3:
next_batch = self._create_fast_final()
elif self.batch_number == 4:
next_batch = self._create_ensemble()
elif self.batch_number == 5:
next_batch = self._create_long_exploration(n=self.top_n)
elif self.batch_number % 2 != 0:
next_batch = self._create_ensemble()
else:
next_batch = self._create_n_pipelines(
self._top_n_pipelines, self.num_long_pipelines_per_batch
)
self._pipeline_number += len(next_batch)
self._batch_number += 1
return next_batch
def _create_naive_pipelines_with_fe(self):
estimators = [
estimator
for estimator in get_estimators(self.problem_type)
if estimator not in self._naive_estimators()
]
parameters = self._pipeline_params if self._pipeline_params else {}
parameters.update(
{"Select Columns Transformer": {"columns": self._selected_cols}}
)
pipelines = [
make_pipeline(
self.X,
self.y,
estimator,
self.problem_type,
sampler_name=self.sampler_name,
parameters=parameters,
extra_components=[DFSTransformer, SelectColumns],
)
for estimator in estimators
]
pipelines = self._create_pipelines_with_params(
pipelines, {"Select Columns Transformer": {"columns": self._selected_cols}}
)
for pipeline in pipelines:
self._create_tuner(pipeline)
return pipelines
```
贡献指南
评估
这个 Issue 还没有评估数据。