Base measure class

class feasel.helpers.feasel_frame.FeaselBase(dataset: ndarray, target: ndarray, selected: set[int] = None, n_features: int = 1, verbose: int = 0)

Bases: ABC

__init__(dataset: ndarray, target: ndarray, selected: set[int] = None, n_features: int = 1, verbose: int = 0)

Abstract base class for all feature selection algorithms within the Adaptive, Hybrid Feature Selection framework.

Parameters:
  • dataset (np.ndarray) – Dataset of size (n_samples, n_features).

  • target (np.ndarray) – Target vector of size (n_samples,).

  • selected (set[int]) – Already selected feature index set of size (n_selected,). Default value is None.

  • n_features (int) – Number of features to select. Default value is 1.

  • verbose (int) – Verbosity. 0: no output; 1: prints execution time, selected feature and metric; 2: prints every step. Recommend turning off parallel execution when verbose is 2. Default value is 0.

Variables:
  • _flags – Dictionary of flags describing the capabilities of the algorithm.

  • _measures_used – Set of measure names used in the algorithm.

  • _name – Name of the algorithm.

Returns:

None

Return type:

None

fit(measures: dict[str, ndarray]) None

Getter function for measure matrices used in the algorithm.

Parameters:

measures (dict[str, np.ndarray]) – Dictionary of measure matrices used in the algorithm.

Returns:

None

Return type:

None

abstractmethod transform() tuple[ndarray, ndarray, ndarray, float]

Abstract transform method.

Returns:

Selected feature index or indices, measure values for all features, feature order, execution time; tuple of size (4,).

Return type:

tuple