Tuning

class fedot.core.pipelines.tuning.tuner_interface.HyperoptTuner(pipeline, task, iterations=100, early_stopping_rounds=None, timeout=datetime.timedelta(seconds=300), log=None, search_space=<fedot.core.pipelines.tuning.search_space.SearchSpace object>, algo=None)

Bases: abc.ABC

Base class for hyperparameters optimization based on hyperopt library

Attribute pipeline

pipeline to optimize

Attribute task

task (classification, regression, ts_forecasting, clustering)

Attribute iterations

max number of iterations

Attribute search_space

SearchSpace instance

Attribute algo

algorithm for hyperparameters optimization with signature similar to hyperopt.tse.suggest

Parameters
  • timeout (datetime.timedelta) –

  • log (Optional[fedot.core.log.Log]) –

  • search_space (ClassVar) –

  • algo (Callable) –

abstract tune_pipeline(input_data, loss_function, loss_params=None, cv_folds=None, validation_blocks=None)

Function for hyperparameters tuning on the pipeline

Parameters
  • input_data – data used for hyperparameter searching

  • loss_function – function to minimize (or maximize) the metric,

  • cv_folds (int) –

  • validation_blocks (int) –

such function should take vector with true values as first values and predicted array as the second :param loss_params: dictionary with parameters for loss function :param cv_folds: number of folds for cross validation :param validation_blocks: number of validation blocks for time series forecasting

Return fitted_pipeline

pipeline with optimized hyperparameters

Parameters
  • cv_folds (int) –

  • validation_blocks (int) –

get_metric_value(data, pipeline, loss_function, loss_params)

Method calculates metric for algorithm validation

Parameters
  • data – InputData for validation

  • pipeline – pipeline to validate

  • loss_function – function to minimize (or maximize)

  • loss_params – parameters for loss function

Returns

value of loss function

init_check(data, loss_function, loss_params)

Method get metric on validation set before start optimization

Parameters
  • data – InputData for validation

  • loss_function – function to minimize (or maximize)

  • loss_params – parameters for loss function

Return type

None

final_check(data, tuned_pipeline, loss_function, loss_params)

Method propose final quality check after optimization process

Parameters
  • data – InputData for validation

  • tuned_pipeline – tuned pipeline

  • loss_function – function to minimize (or maximize)

  • loss_params – parameters for loss function