macrosynergy.learning.preprocessing.panel_selectors.base_panel_selector#

Base class for feature selection on panel data.

class BasePanelSelector[source]#

Bases: BaseEstimator, SelectorMixin, ABC

Base class for statistical feature selection over a panel.

fit(X, y=None)[source]#

Learn optimal features based on a training set pair (X, y).

Parameters:
abstract determine_features(X, y)[source]#

Determine mask of selected features based on a training set pair (X, y).

Parameters:
Returns:

mask – Boolean mask of selected features.

Return type:

np.ndarray

transform(X)[source]#

Transform method to return only the selected features of the dataframe.

Parameters:

X (pandas.DataFrame) – The feature matrix.

Returns:

X_transformed – The feature matrix with only the selected features.

Return type:

pandas.DataFrame

get_feature_names_out()[source]#

Method to mask feature names according to selected features.