MRMRFeatureSelectionTransform

class MRMRFeatureSelectionTransform(relevance_table: etna.analysis.feature_relevance.relevance.RelevanceTable, top_k: int, features_to_use: Union[List[str], Literal['all']] = 'all', relevance_aggregation_mode: str = AggregationMode.mean, redundancy_aggregation_mode: str = AggregationMode.mean, atol: float = 1e-10, **relevance_params)[source]

Bases: etna.transforms.feature_selection.base.BaseFeatureSelectionTransform

Transform that selects features according to MRMR variable selection method adapted to the timeseries case.

Notes

Transform works with any type of features, however most of the models works only with regressors. Therefore, it is recommended to pass the regressors into the feature selection transforms.

Init MRMRFeatureSelectionTransform.

Parameters
  • relevance_table (etna.analysis.feature_relevance.relevance.RelevanceTable) – method to calculate relevance table

  • top_k (int) – num of features to select; if there are not enough features, then all will be selected

  • features_to_use (Union[List[str], Literal['all']]) – columns of the dataset to select from if “all” value is given, all columns are used

  • relevance_aggregation_mode (str) – the method for relevance values per-segment aggregation

  • redundancy_aggregation_mode (str) – the method for redundancy values per-segment aggregation

  • atol (float) – the absolute tolerance to compare the float values

Inherited-members

Methods

fit(df)

Fit the method and remember features to select.

fit_transform(df)

May be reimplemented.

inverse_transform(df)

Inverse transforms dataframe.

transform(df)

Select top_k features.

fit(df: pandas.core.frame.DataFrame) etna.transforms.feature_selection.feature_importance.MRMRFeatureSelectionTransform[source]

Fit the method and remember features to select.

Parameters

df (pandas.core.frame.DataFrame) – dataframe with all segments data

Returns

result – instance after fitting

Return type

MRMRFeatureSelectionTransform