Class Population
java.lang.Object
unifeat.featureSelection.wrapper.GABasedMethods.BasicPopulation<Individual>
unifeat.featureSelection.wrapper.GABasedMethods.SimpleGA.Population
This java class is used to implement a population of individuals in simple
genetic algorithm (Simple GA) method in which the type of individual is
extended from Individual class.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Fields inherited from class unifeat.featureSelection.wrapper.GABasedMethods.BasicPopulation
CROSS_OVER_RATE, CROSSOVER_TYPE, fitnessEvaluator, MUTATION_RATE, MUTATION_TYPE, population, POPULATION_SIZE, PROBLEM_DIMENSION, REPLACEMENT_TYPE, SELECTION_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method evaluates the fitness of each individual in the population by predefined fitness function.double[]This method returns an array of fitness values of individuals in a populationThis method returns the fittest individual in the populationvoidThis method initializes each individual in the population.voidThis method recombines (cross over) the parents to generate new offsprings.voidThis method handles populations from one generation to the next generation.voidThis method mutates new offsprings by changing the value of some genes in them.voidThis method selects parents from the individuals of a population according to their fitness that will recombine for next generation.
-
Constructor Details
-
Population
public Population()Initializes the parameters
-
-
Method Details
-
initialization
public void initialization()This method initializes each individual in the population. Each individual is randomly initialized.- Specified by:
initializationin classBasicPopulation<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.- Specified by:
evaluateFitnessin classBasicPopulation<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:
operateSelectionin classBasicPopulation<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:
operateCrossOverin classBasicPopulation<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:
operateMutationin classBasicPopulation<Individual>
-
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:
operateGenerationReplacementin classBasicPopulation<Individual>
-
getFittestIndividual
This method returns the fittest individual in the population- Specified by:
getFittestIndividualin classBasicPopulation<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:
getFitnessin classBasicPopulation<Individual>- Returns:
- an array of fitness values of individuals
-