AutoBase¶
- class AutoBase(target_metric: etna.metrics.base.Metric, horizon: int, metric_aggregation: Literal['median', 'mean', 'std', 'percentile_5', 'percentile_25', 'percentile_75', 'percentile_95'] = 'mean', backtest_params: Optional[dict] = None, experiment_folder: Optional[str] = None, runner: Optional[etna.auto.runner.base.AbstractRunner] = None, storage: Optional[optuna.storages._base.BaseStorage] = None, metrics: Optional[List[etna.metrics.base.Metric]] = None)[source]¶
Bases:
etna.auto.auto.AutoAbstract
Base Class for
Auto
andTune
, implementing core logic behind these classes.Initialize AutoBase class.
- Parameters
target_metric (etna.metrics.base.Metric) – Metric to optimize.
horizon (int) – Horizon to forecast for.
metric_aggregation (Literal['median', 'mean', 'std', 'percentile_5', 'percentile_25', 'percentile_75', 'percentile_95']) – Aggregation method for per-segment metrics. By default, mean aggregation is used.
backtest_params (Optional[dict]) – Custom parameters for backtest instead of default backtest parameters.
experiment_folder (Optional[str]) – Name for saving experiment results, it determines the name for optuna study. By default, isn’t set.
runner (Optional[etna.auto.runner.base.AbstractRunner]) – Runner to use for distributed training. By default,
LocalRunner
is used.storage (Optional[optuna.storages._base.BaseStorage]) – Optuna storage to use. By default, sqlite storage is used with name “etna-auto.db”.
metrics (Optional[List[etna.metrics.base.Metric]]) – List of metrics to compute. By default,
Sign
,SMAPE
,MAE
,MSE
,MedAE
metrics are used.
- Inherited-members
Methods
fit
(ts[, timeout, n_trials, initializer, ...])Start automatic pipeline selection.
summary
()Get trials summary.
top_k
([k])Get top k pipelines with the best metric value.
- top_k(k: int = 5) List[etna.pipeline.base.BasePipeline] [source]¶
Get top k pipelines with the best metric value.
Only complete and non-duplicate studies are taken into account.
- Parameters
k (int) – Number of pipelines to return.
- Returns
List of top k pipelines.
- Return type