culebra.solution.feature_selection module¶
Species and solutions for feature selection problems.
This module provides all the classes necessary to solve feature selection problems with culebra. The possible solutions to the problem are handled by:
A
Solutionabstract class defining the interface for feature selectors.A
Speciesclass to define the characteristics that the desired selected features should meet.
Two ndarray-based implementations of the
Solution class are also
provided:
BinarySolution: Solutions are coded as boolean vectors of a fixed length, the number of selectable features. One boolean value is associated to each selectable feature. If the boolean value isTrue, then the feature is selected, otherwise the feature is ignored.IntSolution: Solutions are coded as vectors of feature indices. Only features whose indices are present in the solution are selected. Thus, solutions may have different lengths and can not contain repeated indices.
In order to make possible the application of evolutionary approaches to this
problem, the following Individual
implementations are provided:
BitVector: Inherits fromBinarySolutionandIndividualto provide crossover and mutation operators to binary solutions.IntVector: Inherits fromIntSolutionandIndividualto provide crossover and mutation operators to feature index-based solutions.
Ant Colony Optimization is also supported by the
Ant class, which inherits from
IntSolution and
culebra.solution.abc.Ant to add all the path handling stuff to
feature index-based solutions.
Finally, this module also provides the
Metrics class, which supplies
several metrics about the selected features finally obtained.
Attributes¶
- DEFAULT_PROP = 0.15¶
Default proportion for the generation of a species
- MAX_PROP = 0.25¶
Maximum proportion for the generation of a species

