console_logger¶
Classes
|
Log any events and metrics to stderr output. |
- class ConsoleLogger(table: bool = True)[source]¶
Log any events and metrics to stderr output. Uses loguru.
Create instance of ConsoleLogger.
- Parameters
table (bool) – Indicator for writing tables to the console
- finish_experiment(*args, **kwargs)¶
Finish experiment.
- log(msg: Union[str, Dict[str, Any]], **kwargs)[source]¶
Log any event.
e.g. “Fitted segment segment_name” to stderr output.
- Parameters
msg (Union[str, Dict[str, Any]]) – Message or dict to log
kwargs – Parameters for changing additional info in log message
- log_backtest_metrics(ts: TSDataset, metrics_df: pandas.core.frame.DataFrame, forecast_df: pandas.core.frame.DataFrame, fold_info_df: pandas.core.frame.DataFrame)[source]¶
Write metrics to logger.
- Parameters
ts (TSDataset) – TSDataset to with backtest data
metrics_df (pandas.core.frame.DataFrame) – Dataframe produced with
etna.pipeline.Pipeline._get_backtest_metrics()
forecast_df (pandas.core.frame.DataFrame) – Forecast from backtest
fold_info_df (pandas.core.frame.DataFrame) – Fold information from backtest
Notes
The result of logging will be different for
aggregate_metrics=True
andaggregate_metrics=False
options inbacktest()
.
- log_backtest_run(metrics: pandas.core.frame.DataFrame, forecast: pandas.core.frame.DataFrame, test: pandas.core.frame.DataFrame)¶
Backtest metrics from one fold to logger.
- Parameters
metrics (pandas.core.frame.DataFrame) – Dataframe with metrics from backtest fold
forecast (pandas.core.frame.DataFrame) – Dataframe with forecast
test (pandas.core.frame.DataFrame) – Dataframe with ground truth
- set_params(**params: dict) etna.core.mixins.TMixin ¶
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 – Estimator parameters
self (etna.core.mixins.TMixin) –
params (dict) –
- Returns
New instance with changed parameters
- Return type
etna.core.mixins.TMixin
Examples
>>> from etna.pipeline import Pipeline >>> from etna.models import NaiveModel >>> from etna.transforms import AddConstTransform >>> model = 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, )
- start_experiment(*args, **kwargs)¶
Start experiment.
Complete logger initialization or reinitialize it before the next experiment with the same name.
- to_dict()¶
Collect all information about etna object in dict.
- property pl_logger¶
Pytorch lightning loggers.