etna.analysis.plot_feature_relevance#

plot_feature_relevance(ts: TSDataset, relevance_table: RelevanceTable, normalized: bool = False, relevance_aggregation_mode: str | Literal['per-segment'] = AggregationMode.mean, relevance_params: Dict[str, Any] | None = None, top_k: int | None = None, alpha: float = 0.05, segments: List[str] | None = None, columns_num: int = 2, figsize: Tuple[int, int] = (10, 5))[source]#

Plot relevance of the features.

The most important features are at the top, the least important are at the bottom.

For StatisticsRelevanceTable also plot vertical line: transformed significance level.

  • Values that lie to the right of this line have p-value < alpha.

  • And the values that lie to the left have p-value > alpha.

Parameters:
  • ts (TSDataset) – TSDataset with timeseries data

  • relevance_table (RelevanceTable) –

    method to evaluate the feature relevance;

  • normalized (bool) – whether obtained relevances should be normalized to sum up to 1

  • relevance_aggregation_mode (str | Literal['per-segment']) – aggregation strategy for obtained feature relevance table; all the strategies can be examined at AggregationMode

  • relevance_params (Dict[str, Any] | None) – additional keyword arguments for the __call__ method of RelevanceTable

  • top_k (int | None) – number of best features to plot, if None plot all the features

  • alpha (float) – significance level, default alpha = 0.05, only for StatisticsRelevanceTable

  • segments (List[str] | None) – segments to use

  • columns_num (int) – if relevance_aggregation_mode="per-segment" number of columns in subplots, otherwise the value is ignored

  • figsize (Tuple[int, int]) – size of the figure per subplot with one segment in inches