sequential_engine#

A Future-like api for jobs created by the SequentialEngine, an Engine that sequentially computes the submitted jobs.

Module Contents#

Classes Summary#

SequentialComputation

A Future-like api for jobs created by the SequentialEngine, an Engine that sequentially computes the submitted jobs.

SequentialEngine

The default engine for the AutoML search.

Contents#

class evalml.automl.engine.sequential_engine.SequentialComputation(work, **kwargs)[source]#

A Future-like api for jobs created by the SequentialEngine, an Engine that sequentially computes the submitted jobs.

In order to separate the engine from the AutoMLSearch loop, we need the sequential computations to behave the same way as concurrent computations from AutoMLSearch’s point-of-view. One way to do this is by delaying the computation in the sequential engine until get_result is called. Since AutoMLSearch will call get_result only when the computation is “done”, by always returning True in done() we make sure that get_result is called in the order that the jobs are submitted. So the computations happen sequentially!

Parameters

work (callable) – Computation that should be done by the engine.

Methods

cancel

Cancel the current computation.

done

Whether the computation is done.

get_result

Gets the computation result. Will block until the computation is finished.

cancel(self)[source]#

Cancel the current computation.

done(self)[source]#

Whether the computation is done.

Returns

Always returns True.

Return type

bool

get_result(self)[source]#

Gets the computation result. Will block until the computation is finished.

Raises

Exception – If computation fails. Returns traceback.

Returns

Computation results.

class evalml.automl.engine.sequential_engine.SequentialEngine[source]#

The default engine for the AutoML search.

Trains and scores pipelines locally and sequentially.

Methods

close

No-op.

setup_job_log

Set up logger for job.

submit_evaluation_job

Submit a job to evaluate a pipeline.

submit_scoring_job

Submit a job to score a pipeline.

submit_training_job

Submit a job to train a pipeline.

close(self)[source]#

No-op.

static setup_job_log()#

Set up logger for job.

submit_evaluation_job(self, automl_config, pipeline, X, y, X_holdout=None, y_holdout=None)[source]#

Submit a job to evaluate a pipeline.

Parameters
  • automl_config – Structure containing data passed from AutoMLSearch instance.

  • pipeline (pipeline.PipelineBase) – Pipeline to evaluate.

  • X (pd.DataFrame) – Input data for modeling.

  • y (pd.Series) – Target data for modeling.

  • X_holdout (pd.Series) – Holdout input data for holdout scoring.

  • y_holdout (pd.Series) – Holdout target data for holdout scoring.

Returns

Computation result.

Return type

SequentialComputation

submit_scoring_job(self, automl_config, pipeline, X, y, objectives, X_train=None, y_train=None)[source]#

Submit a job to score a pipeline.

Parameters
  • automl_config – Structure containing data passed from AutoMLSearch instance.

  • pipeline (pipeline.PipelineBase) – Pipeline to train.

  • X (pd.DataFrame) – Input data for modeling.

  • y (pd.Series) – Target data for modeling.

  • X_train (pd.DataFrame) – Training features. Used for feature engineering in time series.

  • y_train (pd.Series) – Training target. Used for feature engineering in time series.

  • objectives (list[ObjectiveBase]) – List of objectives to score on.

Returns

Computation result.

Return type

SequentialComputation

submit_training_job(self, automl_config, pipeline, X, y)[source]#

Submit a job to train a pipeline.

Parameters
  • automl_config – Structure containing data passed from AutoMLSearch instance.

  • pipeline (pipeline.PipelineBase) – Pipeline to evaluate.

  • X (pd.DataFrame) – Input data for modeling.

  • y (pd.Series) – Target data for modeling.

Returns

Computation result.

Return type

SequentialComputation