etna.loggers._Logger#
- class _Logger[source]#
Bases:
BaseLogger
Composite for loggers.
Create instance for composite of loggers.
Methods
add
(logger)Add new logger.
disable
()Context manager for local logging disabling.
Finish experiment.
log
(msg, **kwargs)Log any event.
log_backtest_metrics
(ts, metrics_df, ...)Write metrics to logger.
log_backtest_run
(metrics, forecast, test)Backtest metrics from one fold to logger.
remove
(idx)Remove logger by identifier.
set_params
(**params)Return new object instance with modified parameters.
start_experiment
(*args, **kwargs)Start experiment.
to_dict
()Collect all information about etna object in dict.
Attributes
This class stores its
__init__
parameters as attributes.Pytorch lightning loggers.
- add(logger: BaseLogger) int [source]#
Add new logger.
- Parameters:
logger (BaseLogger) – logger to be added
- Returns:
result – identifier of added logger
- Return type:
- log_backtest_metrics(ts: TSDataset, metrics_df: DataFrame, forecast_df: DataFrame, fold_info_df: DataFrame)[source]#
Write metrics to logger.
- log_backtest_run(metrics: DataFrame, forecast: DataFrame, test: DataFrame)[source]#
Backtest metrics from one fold to logger.
- remove(idx: int)[source]#
Remove logger by identifier.
- Parameters:
idx (int) – identifier of added logger
- set_params(**params: dict) Self [source]#
Return new object instance with modified parameters.
Method also allows to change parameters of nested objects within the current object. For example, it is possible to change parameters of a
model
in aPipeline
.Nested parameters are expected to be in a
<component_1>.<...>.<parameter>
form, where components are separated by a dot.- Parameters:
**params (dict) – Estimator parameters
- Returns:
New instance with changed parameters
- Return type:
Self
Examples
>>> from etna.pipeline import Pipeline >>> from etna.models import NaiveModel >>> from etna.transforms import AddConstTransform >>> model = NaiveModel(lag=1) >>> transforms = [AddConstTransform(in_column="target", value=1)] >>> pipeline = Pipeline(model, transforms=transforms, horizon=3) >>> pipeline.set_params(**{"model.lag": 3, "transforms.0.value": 2}) Pipeline(model = NaiveModel(lag = 3, ), transforms = [AddConstTransform(in_column = 'target', value = 2, inplace = True, out_column = None, )], horizon = 3, )