Research Article

Genetic Algorithm Based Approach in Attribute Weighting for a Medical Data Set

Pseudocode 1

Pseudocode of the genetic algorithm used in the evolution of the attribute weight values with 10-fold cross-validation.
population_size = 21
   //Crossover rate
   //Mutation rate
divide data into 10 equally-sized subsets
for  cv_round = 1 to 10 do
     divide training data D- into train (6 subsets) and test (3 subsets) data
     initialize methods with train data:
      cwk-NN and wk-NN OVA: HVDM initialization
       ONE: fitness value calculation for values of attributes
     evaluate starting population Weights with test data and ONE/cwk-NN/wk-NN OVA
     while ending terms of GA are not fulfilled do
       //Survivor selection: Elitism
       search for the individual with the highest fitness rate from the population
       //Parent selection: Roulette-wheel selection with fitness-proportionate selection
      for each individual in the population do
          calculate individual’s fitness proportionate rate = individual‘s fitness rate/sum of individuals’
          fitness rates
          calculate individual’s cumulative fitness proportionate rate
      end for
      while nr of individuals in the mating pool is smaller than population_size do
          generate a random number r from
          search for the jth individual that has smaller cumulative fitness proportionate rate than
          add the jth individual in the mating pool
      end while
       //Crossover: Uniform crossover with discrete recombination
      for each individual in the mating pool do
          generate a random number s from
          if    is smaller than   then
            add the individual in the parent pool
          else
            add the individual in the new population (offspring is a direct copy of its parent)
          end if
      end for
      while two individuals can be taken from the parent pool do
          if two individuals are exactly the same then
            add the first individual into the new population
            take new individual from the parent pool to use in the crossover
          end if
          for each disease class weight set do
            select the crossover points randomly
            swap information of two individuals in the corresponding crossover points (create children)
          end for
          add children in the new population
      end while
       //Mutation: Uniform mutation
      for each individual in the new population do
          for each gene of individual do
            generate a random number from
            if    is smaller than   then
                select a random value from the range
                set the value v as a new value of the gene
            end if
          end for
      end for
       evaluate children and mutated individuals in the new population with test data and
       ONE/-NN/-NN
       add the elite individual without changes into the new population
       //Survivor Selection
      if nr of individuals in the new population is larger than population_size then
          sort cases descending by their fitness rate
          discard the last cases in order to have correct nr of individuals in the population
      else if nr of individuals in the new population is smaller than population_size then
          select randomly missing cases from the old population
      end if
     end while
     initialize methods with training data D-:
      cwk-NN and wk-NN OVA: HVDM initialization
       ONE: fitness value calculation for values of attributes
     evaluate the individual with the highest fitness rate after GA with testing data and
     ONE/cwk-NN/wk-NN OVA
end for