lale.lib.lale.auto_pipeline module

class lale.lib.lale.auto_pipeline.AutoPipeline(*, prediction_type='classification', scoring, best_score=0.0, verbose=False, max_evals=100, max_opt_time=600.0, max_eval_time=120.0, cv=5)

Bases: PlannedIndividualOp

Automatically find a pipeline for a dataset.

This documentation is auto-generated from JSON schemas.

This is a high-level entry point to get an initial trained pipeline without having to specify your own planned pipeline first. It is designed to be simple at the expense of not offering much control. For an example, see demo_auto_pipeline.ipynb.

Parameters
  • prediction_type (‘binary’, ‘multiclass’, ‘classification’, or ‘regression’, not for optimizer, default ‘classification’) – The kind of learning problem.

  • scoring (union type, not for optimizer) –

    Scorer object, or known scorer named by string.

    • None

      When not specified, use accuracy for classification tasks and r2 for regression.

    • or union type

      Scorer object, or known scorer named by string.

      • callable

        Callable with signature scoring(estimator, X, y) as documented in sklearn scoring.

        The callable has to return a scalar value, such that a higher score is better. This may be created from one of the sklearn metrics using make_scorer. Or it can be one of the scoring callables returned by the factory functions in lale.lib.aif360 metrics, for example, symmetric_disparate_impact(**fairness_info). Or it can be a completely custom user-written Python callable.

      • or ‘accuracy’, ‘explained_variance’, ‘max_error’, ‘roc_auc’, ‘roc_auc_ovr’, ‘roc_auc_ovo’, ‘roc_auc_ovr_weighted’, ‘roc_auc_ovo_weighted’, ‘balanced_accuracy’, ‘average_precision’, ‘neg_log_loss’, or ‘neg_brier_score’

        Known scorer for classification task.

      • or ‘r2’, ‘neg_mean_squared_error’, ‘neg_mean_absolute_error’, ‘neg_root_mean_squared_error’, ‘neg_mean_squared_log_error’, or ‘neg_median_absolute_error’

        Known scorer for regression task.

  • best_score (float, optional, not for optimizer, default 0.0) –

    The best score for the specified scorer.

    Given that higher scores are better, passing (best_score - score) as a loss to the minimizing optimizer will maximize the score. By specifying best_score, the loss can be >=0, where 0 is the best loss.

  • verbose (boolean, optional, not for optimizer, default False) – Whether to print errors from each of the trials if any. This is also logged using logger.warning in Hyperopt.

  • max_evals (integer, >=1, not for optimizer, default 100) – Number of trials of Hyperopt search.

  • max_opt_time (union type, not for optimizer, default 600.0) –

    Maximum amount of time in seconds for the optimization.

    • float, >=0.0

    • or None

      No runtime bound.

  • max_eval_time (union type, not for optimizer, default 120.0) –

    Maximum time in seconds for each evaluation.

    • float, >0.0

    • or None

      No runtime bound.

  • cv (union type, not for optimizer, default 5) –

    Cross-validation as integer or as object that has a split function.

    The fit method performs cross validation on the input dataset for per trial, and uses the mean cross validation performance for optimization. This behavior is also impacted by the handle_cv_failure flag.

    • union type

      • integer, >=2, >=3 for optimizer, <=4 for optimizer, uniform distribution, default 5

        Number of folds for cross-validation.

      • or None, not for optimizer

        to use the default 5-fold cross validation

    • or CrossvalGenerator, not for optimizer

      Object with split function: generator yielding (train, test) splits as arrays of indices. Can use any of the iterators from https://scikit-learn.org/stable/modules/cross_validation.html#cross-validation-iterators

fit(X, y=None, **fit_params)

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (array of items : array of items : Any) –

  • y (union type) –

    • array of items : float

    • or array of items : string

    • or array of items : boolean

predict(X, **predict_params)

Make predictions.

Note: The predict method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array of items : array of items : Any) –

Returns

result

  • array of items : float

  • or array of items : string

  • or array of items : boolean

Return type

union type

lale.lib.lale.auto_pipeline.auto_gbt(prediction_type)[source]
lale.lib.lale.auto_pipeline.auto_prep(X)[source]