Class BasicIndividual<GeneType>
java.lang.Object
unifeat.featureSelection.wrapper.GABasedMethods.BasicIndividual<GeneType>
- Type Parameters:
- GeneType- the type of genes of each individual
- Direct Known Subclasses:
- Individual,- Individual
The abstract class contains the main methods and fields that are used in all
 GA-based feature selection methods. This class is used to represent a
 individual in GA algorithm.
- Author:
- Sina Tabakhi
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionBasicIndividual(Class<GeneType> gene, Integer dimension) Initializes the parameters
- 
Method SummaryModifier and TypeMethodDescriptiondoubleThis method returns the fitness value of the individual.abstract intThis method returns the number of selected features by the individual based on its gene vector.abstract int[]This method returns the indices of selected features by the individual based on its gene vector.voidsetFitness(double fitness) This method sets the fitness value of the individual.
- 
Field Details- 
genes
- 
fitnessprivate double fitness
 
- 
- 
Constructor Details- 
BasicIndividualInitializes the parameters- Parameters:
- gene- the type of genes of each individual
- dimension- the dimension of problem which equals to total number of features in the dataset
 
 
- 
- 
Method Details- 
numSelectedFeaturespublic abstract int numSelectedFeatures()This method returns the number of selected features by the individual based on its gene vector.- Returns:
- number of selected features by the individual
 
- 
selectedFeaturesSubsetpublic abstract int[] selectedFeaturesSubset()This method returns the indices of selected features by the individual based on its gene vector.- Returns:
- the array of indices of the selected features by the individual
 
- 
getFitnesspublic double getFitness()This method returns the fitness value of the individual.- Returns:
- the fitness value of the individual
 
- 
setFitnesspublic void setFitness(double fitness) This method sets the fitness value of the individual.- Parameters:
- fitness- the fitness value of the individual
 
 
-