plot_feature_relevance¶
- plot_feature_relevance(ts: TSDataset, relevance_table: etna.analysis.feature_relevance.relevance.RelevanceTable, normalized: bool = False, relevance_aggregation_mode: Union[str, Literal['per-segment']] = AggregationMode.mean, relevance_params: Optional[Dict[str, Any]] = None, top_k: Optional[int] = None, alpha: float = 0.05, segments: Optional[List[str]] = 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 (etna.analysis.feature_relevance.relevance.RelevanceTable) –
method to evaluate the feature relevance;
if
StatisticsRelevanceTable
table is used then relevances are normalized p-valuesif
ModelRelevanceTable
table is used then relevances are importances from some model
normalized (bool) – whether obtained relevances should be normalized to sum up to 1
relevance_aggregation_mode (Union[str, Literal['per-segment']]) – aggregation strategy for obtained feature relevance table; all the strategies can be examined at
AggregationMode
relevance_params (Optional[Dict[str, Any]]) – additional keyword arguments for the
__call__
method ofRelevanceTable
top_k (Optional[int]) – number of best features to plot, if None plot all the features
alpha (float) – significance level, default alpha = 0.05, only for
StatisticsRelevanceTable
segments (Optional[List[str]]) – segments to use
columns_num (int) – if
relevance_aggregation_mode="per-segment"
number of columns in subplots, otherwise the value is ignoredfigsize (Tuple[int, int]) – size of the figure per subplot with one segment in inches