automl.bayesianoptimizationpiepeline package

Submodules

automl.bayesianoptimizationpiepeline.base module

class automl.bayesianoptimizationpiepeline.base.BayesianOptimizationPipeline(dataset=None, pipeline=None, optimize_on='quality', cutoff_time=600, iteration=15, scoring=None, cv=5)

Bases: object

This class deals with the optimization of the hyperparameter of the pipeline.

This class makes use of SMAC3 library which uses the bayesian optimization technique to optimize the hyperparameter of the input pipeline.

Parameters:
  • dataset (Dataset) – A dataset object to work with. Defaults to None.
  • pipeline (Pipeline) – Input pipeline to be optimized. Defaults to None.
  • optimize_on (string) – Optimization parameter that takes input either “quality” or “runtime”. The pipeline can either be optimized based on quality (performance metric) or runtime (time required to complete the bayesian optimization process). Defaults to “quality”.
  • cutoff_time (int) – This hyperparameter is only used when “optimize_on” hyperparameter is set to “runtime”. Maximum time limit in seconds after which the bayesian optimization process stops and best result is given as output. Defaults to 600.
  • iteration (int) – Number of iteration the bayesian optimization process will take. More number of iterations gives better results but increases the execution time. Defaults to 15.
  • scoring (string or callable) – The performance metric on which the pipeline is supposed to be optimized. Example : ‘auc_roc’, ‘accuracy’, ‘precision’, ‘recall’, ‘f1’, etc. Defaults to None.
  • cv (int) – Specifies the number of folds in a (Stratified)KFold. Defaults to 5.
get_optimized_pipeline()

This function returns the optimized pipeline

Raises:TypeError – If the function returns None, then the pipeline has’nt been optimized.
Returns:The optimized pipeline.
Return type:Pipeline
get_optimized_score()

This function returns the optimized score

Raises:TypeError – If the function returns None, then the pipeline has’nt been optimized.
Returns:The optimized score.
Return type:float
optimize_pipeline()

This function is used to initiate the optimization process and obtained the optimized score and pipeline.

This function gets the configuration space from the createconfigspacepipeline subpackage on which the bayesian optimization technique is performed. This function creates a function which consist of the input pipeline which is evaluated based on various hyperparameter setting provided by the bayesian optimization technique (SMAC).

Module contents

Used to perform Bayesian Optimization technique using the configuration space.