java.lang.Object
unifeat.featureSelection.wrapper.GABasedMethods.BasicPopulation<Individual>
unifeat.featureSelection.wrapper.GABasedMethods.HGAFS.Population

public class Population extends BasicPopulation<Individual>
This java class is used to implement a population of individuals in hybrid genetic algorithm for feature selection using local search (HGAFS) in which the type of individual is extended from Individual class.
Author:
Sina Tabakhi
See Also:
  • Field Details

    • EPSILON

      public static double EPSILON
    • MU

      public static double MU
  • Constructor Details

    • Population

      public Population(double epsilon, double mu)
      Initializes the parameters
      Parameters:
      epsilon - the epsilon parameter used in the subset size determining scheme
      mu - the mu parameter used in the local search operation (control similar/dissimilar)
  • Method Details

    • initialization

      public void initialization()
      This method initializes each individual in the population.

      Each individual is randomly initialized in the predefined ranges of values. The number of selected features in each individual is constant and defined by a scheme.

      Specified by:
      initialization in class BasicPopulation<Individual>
    • evaluateFitness

      public void evaluateFitness()
      This method evaluates the fitness of each individual in the population by predefined fitness function. K-fold cross validation on training set is used for evaluating the classification performance of selected feature subset by each individual. Also, inverse of summation of the correlation of selected features by individual is added to the accuracy of classifier.
      Specified by:
      evaluateFitness in class BasicPopulation<Individual>
    • operateSelection

      public void operateSelection()
      This method selects parents from the individuals of a population according to their fitness that will recombine for next generation.

      The selection type is selected based on selectionType by user.

      Specified by:
      operateSelection in class BasicPopulation<Individual>
    • operateCrossOver

      public void operateCrossOver()
      This method recombines (cross over) the parents to generate new offsprings.

      The crossover type is selected based on crossoverType by user.

      Specified by:
      operateCrossOver in class BasicPopulation<Individual>
    • operateMutation

      public void operateMutation()
      This method mutates new offsprings by changing the value of some genes in them.

      The mutation type is selected based on mutationType by user.

      Specified by:
      operateMutation in class BasicPopulation<Individual>
    • operateLocalSearch

      public void operateLocalSearch()
      This method performs a local search strategy on each individual which is based on correlation of features.
    • operateGenerationReplacement

      public void operateGenerationReplacement()
      This method handles populations from one generation to the next generation.

      The replacement type is selected based on replacementType by user.

      Specified by:
      operateGenerationReplacement in class BasicPopulation<Individual>
    • getFittestIndividual

      public Individual getFittestIndividual()
      This method returns the fittest individual in the population
      Specified by:
      getFittestIndividual in class BasicPopulation<Individual>
      Returns:
      the fittest individual in the population
    • getFitness

      public double[] getFitness()
      This method returns an array of fitness values of individuals in a population
      Specified by:
      getFitness in class BasicPopulation<Individual>
      Returns:
      an array of fitness values of individuals
    • setDataInfo

      public void setDataInfo(double[][] data)
      This method sets the information of the dataset.
      Parameters:
      data - the input dataset values