Fitness Function Evaluation Using Ga
Fitness Function Evaluation Using Ga
CHAPTER 6
6.1 INTRODUCTION
Initialize Population of
Chromosomes
Select Good
Chromosome Create New Population of
Chromosomes
Are
stopping No
criteria
satisfied?
Yes
Stop
the population, the corresponding the number of old members are excluded.
Let m denote this constant population size. Since each population may contain
duplicates of chromosomes, express populations by m-tuples whose elements
are n-tuples from the set Gn. Finally, let f denote the fitness function
employed in the algorithm. The algorithm, which is iterative, consists of the
following six steps.
selection is made randomly from the set Gn. The choice of value m is
important. If it is too large, the algorithm does not differ much from an
exhaustive search; it is too small, the algorithm may not reach the optimal
solution.
value ex mgx for each ‘x’ in P k , where gx is a relative fitness defined
by the formula.
f x
gx
f x
x p k
for Pnk , is given by the integer part of ex . If the total number of
chromosomes chosen in this way is smaller than m (the usual case), then
select the remaining chromosomes for Pnk by the fractional parts of ex ,
from the highest values down. In general, the purpose of this procedure is
to eliminate chromosomes with low fitness and duplicate those with high
fitness.
and go to Step 2.
Number of
Chromosome
Integers Fitness g(x) 4g(x) Selected
in P(1)
Copies
00010 2 3.75 0.084 0.336 0
01001 9 12.94 0.292 1.168 1
10011 19 15.44 0.350 1.400 2
11000 24 12.00 0.291 1.084 1
(b) k = 1 : Step 5
Similarly for the values of k 2, 3, values are set to calculate the fitness value,
mate and the crossover site.
Number of
Chromosome
Integers Fitness g(x) 4g(x) Selected
in P(2)
Copies
01011 11 14.44 0.250 0.100 0
10001 17 15.94 0.276 1.104 2
11000 24 12.00 0.207 0.828 1
10011 19 15.44 0.267 1.068 1
(d) k = 2 : Step 5
Number of
Chromosome
Integers Fitness g(x) 4g(x) Selected
in P(2)
Copies
10000 16 16.00 0.274 1.096 1
10011 19 15.44 0.265 1.060 1
11001 25 10.94 0.188 0.752 1
10001 17 15.94 0.273 1.092 1
The input attributes taken for this implementation are AGE, Fasting
Plasma Glucose (FPG), Post Prandial Plasma Glucose (PPG), Gender (G)
(value 1:Male; value 0: Female), P/NP-Pregnant or Non Pregnant (value 1:
pregnant; value 0: non pregnant) and the output attribute taken is Diabetes (D)
(value ≤ 0.5: patient with no diabetes disease; value > 0.5: patient affected
with diabetes disease). The details about the attributes are discussed earlier in
Chapter 3. The parameters of genetic algorithm used for this implementation
are listed in Table 6.2.
From Figure 6.3 it is observed that the best fitness value is 0.425,
which signifies that the patient is non-diabetic. Similary genetic algorithm is
applied to all the data given in Table A 2.1 and the prediction was found to be
accurate.
6.5 SUMMARY
This chapter has presented the genetic algorithm for computing the
prediction accuracy of diabetes. The best fitness value is evaluated for all the
data in the clinical diabetic database to predict whether the patient is affected
with diabetic or not. It is observed that the results obtained using genetic
algorithm is similar to the output obtained using neural network. This
proposed approach showed better accuracy in predicting diabetes.