Fast Correlation-Based Filter in Pieces

class feasel.f_FCBFiP.FastCorriPFS(dataset: ndarray, target: ndarray, n_pieces: int | None = None, n_features: int | None = None, verbose: int = 0)

Bases: FeaselBase

__init__(dataset: ndarray, target: ndarray, n_pieces: int | None = None, n_features: int | None = None, verbose: int = 0)

Implements the Fast Correlation Based Feature Selection in Pieces found in “Intelligent IoT Traffic Classification Using Novel Search Strategy for Fast-Based-Correlation Feature Selection in Industrial Environments” by Egea et al. https://doi.org/10.1109/JIOT.2017.2787959

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

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

  • n_pieces (int) – Number of pieces to divide the feature space into. If None or unsuitable for the given dataset, this value is automatically set to the lowest possible during fit. Default is None.

  • n_features (int) – Number of features to select. If None, returns with a feature order. 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. Note that increased verbosity affects execution time. 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.

Returns:

None

Return type:

None

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

Getter function for measure matrices used in the algorithm. Checks the validity of the n_pieces parameter and adjusts if needed.

Parameters:

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

Returns:

fit time

Return type:

float

transform() tuple[set[int], ndarray[int], float]

Applies the algorithm.

Returns:

Selected feature index or indices, ordered selection, execution time; tuple of size (3,).

Return type:

tuple[set[int], np.ndarray[int], float]