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

public abstract class BasicIndividual<GeneType> extends Object
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 Details

  • Constructor Details

    • BasicIndividual

      public BasicIndividual(Class<GeneType> gene, Integer dimension)
      Initializes 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

    • numSelectedFeatures

      public 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
    • selectedFeaturesSubset

      public 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
    • getFitness

      public double getFitness()
      This method returns the fitness value of the individual.
      Returns:
      the fitness value of the individual
    • setFitness

      public void setFitness(double fitness)
      This method sets the fitness value of the individual.
      Parameters:
      fitness - the fitness value of the individual