Class Individual
java.lang.Object
unifeat.featureSelection.wrapper.GABasedMethods.BasicIndividual<Boolean>
unifeat.featureSelection.wrapper.GABasedMethods.HGAFS.Individual
This java class is used to represent an individual in simple genetic
algorithm (Simple GA) method in which the type of gene vector is boolean.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Fields inherited from class unifeat.featureSelection.wrapper.GABasedMethods.BasicIndividual
genes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThis method returns the number of selected features by the individual based on its gene vector.int[]This method returns the indices of selected features by the individual based on its gene vector.Methods inherited from class unifeat.featureSelection.wrapper.GABasedMethods.BasicIndividual
getFitness, setFitness
-
Constructor Details
-
Individual
public Individual(int dimension) Initializes the parameters- Parameters:
dimension- the dimension of problem which equals to total number of features in the dataset
-
-
Method Details
-
numSelectedFeatures
public int numSelectedFeatures()This method returns the number of selected features by the individual based on its gene vector.- Specified by:
numSelectedFeaturesin classBasicIndividual<Boolean>- Returns:
- number of selected features by the individual
-
selectedFeaturesSubset
public int[] selectedFeaturesSubset()This method returns the indices of selected features by the individual based on its gene vector.- Specified by:
selectedFeaturesSubsetin classBasicIndividual<Boolean>- Returns:
- the array of indices of the selected features by the individual
-