fraction_find_best_feature

bcselector.filter_methods.cost_based_filter_methods.fraction_find_best_feature(j_criterion_func, r, data, target_variable, possible_variables_index, costs, normalized_costs, **kwargs)[source]

Function that ranks all features with selected j_criterion_func according to fraction method and returns the feature with highest criterion value.

Parameters
  • j_criterion_func (function) – Function from bcselector.information_theory.j_criterion_approximations

  • r (float or int) – Scalling parameter (Impact of cost on whole approximation).

  • data (np.array matrix) – Matrix of data set. Columns are variables, rows are observations.

  • target_variable (int or float) – Target variable. Can not be in data!

  • prev_variables_index (list of ints) – Indexes of previously selected variables.

  • possible_variables_index (list of ints) – Index of all candidate variables in data matrix.

  • costs (list of ints or floats) – List of costs of all variables in data matrix.

  • **kwargs – Other parameters passed to j_criterion_func

Returns

  • index_of_best_feature (int) – Index of best feature due to criterion.

  • value_of_criterion (float) – Value of fraction_criterion for this feature.

  • cost_of_best_feature (float or int) – Cost of best selected feature

difference_find_best_feature

bcselector.filter_methods.cost_based_filter_methods.difference_find_best_feature(j_criterion_func, lamb, data, target_variable, possible_variables_index, costs, normalized_costs, **kwargs)[source]

Function that ranks all features with selected j_criterion_func according to difference method and returns the feature with highest criterion value.

Parameters
  • j_criterion_func (function) – Function from bcselector.information_theory.j_criterion_approximations

  • beta (float or int) – Scalling parameter (Impact of cost on whole approximation).

  • data (np.array matrix) – Matrix of data set. Columns are variables, rows are observations.

  • target_variable (int or float) – Target variable. Can not be in data!

  • prev_variables_index (list of ints) – Indexes of previously selected variables.

  • possible_variables_index (list of ints) – Index of all candidate variables in data matrix.

  • costs (list of ints or floats) – List of costs of all variables in data matrix.

  • **kwargs – Other parameters passed to j_criterion_func

Returns

  • index_of_best_feature (int) – Index of best feature due to criterion.

  • value_of_criterion (float) – Value of fraction_criterion for this feature.

  • cost_of_best_feature (float or int) – Cost of best selected feature