default_algorithm#

An automl algorithm that consists of two modes: fast and long, where fast is a subset of long.

Module Contents#

Classes Summary#

DefaultAlgorithm

An automl algorithm that consists of two modes: fast and long, where fast is a subset of long.

Contents#

class evalml.automl.automl_algorithm.default_algorithm.DefaultAlgorithm(X, y, problem_type, sampler_name, allowed_model_families=None, excluded_model_families=None, tuner_class=None, random_seed=0, search_parameters=None, n_jobs=1, text_in_ensembling=False, top_n=3, ensembling=False, num_long_explore_pipelines=50, num_long_pipelines_per_batch=10, allow_long_running_models=False, features=None, run_feature_selection=True, verbose=False, exclude_featurizers=None)[source]#

An automl algorithm that consists of two modes: fast and long, where fast is a subset of long.

  1. Naive pipelines:
    1. run baseline with default preprocessing pipeline

    2. run naive linear model with default preprocessing pipeline

    3. run basic RF pipeline with default preprocessing pipeline

  2. Naive pipelines with feature selection
    1. subsequent pipelines will use the selected features with a SelectedColumns transformer

At this point we have a single pipeline candidate for preprocessing and feature selection

  1. Pipelines with preprocessing components:
    1. scan rest of estimators (our current batch 1).

  2. First ensembling run

Fast mode ends here. Begin long mode.

  1. Run top 3 estimators:
    1. Generate 50 random parameter sets. Run all 150 in one batch

  2. Second ensembling run

  3. Repeat these indefinitely until stopping criterion is met:
    1. For each of the previous top 3 estimators, sample 10 parameters from the tuner. Run all 30 in one batch

    2. Run ensembling

Parameters
  • X (pd.DataFrame) – Training data.

  • y (pd.Series) – Target data.

  • problem_type (ProblemType) – Problem type associated with training data.

  • sampler_name (BaseSampler) – Sampler to use for preprocessing.

  • tuner_class (class) – A subclass of Tuner, to be used to find parameters for each pipeline. The default of None indicates the SKOptTuner will be used.

  • random_seed (int) – Seed for the random number generator. Defaults to 0.

  • search_parameters (dict or None) – Pipeline-level parameters and custom hyperparameter ranges specified for pipelines to iterate over. Hyperparameter ranges must be passed in as skopt.space objects. Defaults to None.

  • n_jobs (int or None) – Non-negative integer describing level of parallelism used for pipelines. Defaults to -1.

  • text_in_ensembling (boolean) – If True and ensembling is True, then n_jobs will be set to 1 to avoid downstream sklearn stacking issues related to nltk. Defaults to False.

  • top_n (int) – top n number of pipelines to use for long mode.

  • num_long_explore_pipelines (int) – number of pipelines to explore for each top n pipeline at the start of long mode.

  • num_long_pipelines_per_batch (int) – number of pipelines per batch for each top n pipeline through long mode.

  • allow_long_running_models (bool) – Whether or not to allow longer-running models for large multiclass problems. If False and no pipelines, component graphs, or model families are provided, AutoMLSearch will not use Elastic Net or XGBoost when there are more than 75 multiclass targets and will not use CatBoost when there are more than 150 multiclass targets. Defaults to False.

  • features (list) – List of features to run DFS on in AutoML pipelines. Defaults to None. Features will only be computed if the columns used by the feature exist in the input and if the feature has not been computed yet.

  • run_feature_selection (bool) – If True, will run a separate feature selection pipeline and only use selected features in subsequent batches. If False, will use all of the features for every pipeline. Only used for default algorithm.

  • verbose (boolean) – Whether or not to display logging information regarding pipeline building. Defaults to False.

  • exclude_featurizers (list[str]) – A list of featurizer components to exclude from the pipelines built by DefaultAlgorithm. Valid options are “DatetimeFeaturizer”, “EmailFeaturizer”, “URLFeaturizer”, “NaturalLanguageFeaturizer”, “TimeSeriesFeaturizer”

  • allowed_model_families (list(str, ModelFamily)) – The model families to search. The default of None searches over all model families. Run evalml.pipelines.components.utils.allowed_model_families(“binary”) to see options. Change binary to multiclass or regression depending on the problem type. For default algorithm, this only applies to estimators in the non-naive batches.

  • excluded_model_families (list(str, ModelFamily)) – A list of model families to exclude from the estimators used when building pipelines. For default algorithm, this only excludes estimators in the non-naive batches.

Methods

add_result

Register results from evaluating a pipeline. In batch number 2, the selected column names from the feature selector are taken to be used in a column selector. Information regarding the best pipeline is updated here as well.

batch_number

Returns the number of batches which have been recommended so far.

default_max_batches

Returns the number of max batches AutoMLSearch should run by default.

next_batch

Get the next batch of pipelines to evaluate.

num_pipelines_per_batch

Return the number of pipelines in the nth batch.

pipeline_number

Returns the number of pipelines which have been recommended so far.

add_result(self, score_to_minimize, pipeline, trained_pipeline_results, cached_data=None)[source]#

Register results from evaluating a pipeline. In batch number 2, the selected column names from the feature selector are taken to be used in a column selector. Information regarding the best pipeline is updated here as well.

Parameters
  • score_to_minimize (float) – The score obtained by this pipeline on the primary objective, converted so that lower values indicate better pipelines.

  • pipeline (PipelineBase) – The trained pipeline object which was used to compute the score.

  • trained_pipeline_results (dict) – Results from training a pipeline.

  • cached_data (dict) – A dictionary of cached data, where the keys are the model family. Expected to be of format {model_family: {hash1: trained_component_graph, hash2: trained_component_graph…}…}. Defaults to None.

property batch_number(self)#

Returns the number of batches which have been recommended so far.

property default_max_batches(self)#

Returns the number of max batches AutoMLSearch should run by default.

next_batch(self)[source]#

Get the next batch of pipelines to evaluate.

Returns

a list of instances of PipelineBase subclasses, ready to be trained and evaluated.

Return type

list(PipelineBase)

num_pipelines_per_batch(self, batch_number)[source]#

Return the number of pipelines in the nth batch.

Parameters

batch_number (int) – which batch to calculate the number of pipelines for.

Returns

number of pipelines in the given batch.

Return type

int

property pipeline_number(self)#

Returns the number of pipelines which have been recommended so far.