Genetic Algorithm-Machine Learning Adi
Genetic Algorithm-Machine Learning Adi
Genetic algorithm
Genetic algorithm in machine learning is mainly adaptive heuristic or search engine algorithms
that provide solutions for search and optimization problems in machine learning. It is a
methodology that solves unconstrained and constrained optimization problems based on natural
selection. You can solve such complex problems quickly that would have taken a much longer
time when done manually.
They are one search optimization algorithm that helps in discovering the best possible solution
by taking all the constraints into consideration. Moreover, it leverages guided random search,
unlike other algorithms. It refers to finding the optimal solution by initiating the process with a
random initial cost function and then searching for the one with the least cost in the space. It
comes in handy when you are discovering solutions for huge and complex datasets.
What is the foundation of genetic algorithms in machine learning?
Charles Darwin's idea of natural evolution served as an inspiration for genetic programming in
machine learning. It showcases how natural selection works in humans, where the fittest
individuals are chosen for reproducing offspring to take the present generation ahead.
To put it simply, it refers to the survival of the fittest for solving a problem amidst the individuals
of consecutive generations.
How genetic algorithm works?
In order to understand the simple genetic algorithm and how it works, there are some basic
terminologies that will help you understand it better. We have described them below.
➢ Genetic operators: In genetic algorithms, genetic operators are used when you wish to
change the genetic composition of the next generation.
➢ Chromosome/Individual: It refers to the collection of genes that can be represented with
a string of each bit as a gene.
➢ Population: Each chromosome represents an individual and a collection of
chromosomes/individual make up the population.
➢ Fitness function: This function in genetic algorithms produces an improved output for a
specific input.
Now let’s move on to understand the working of genetic algorithms in machine learning.
There are five phases that illustrate the entire process of how this algorithm works.
Dr. K. Adisesha 1
Genetic algorithm Machine Learning
1. Initialization
The working of genetic algorithms starts with the process of initialization where a set of
individuals is generated that we refer to as population. It contains a set of parameters called
genes that are combined into a string and generate chromosomes. These chromosomes are the
solution to the problem that are derived by the technique of random binary strings.
2. Fitness assignment
The fitness function of the genetic algorithm determines an individual’s ability to compete with
other individuals. It provides the score to each individual that determines its probability of being
selected for the process of reproduction.
Higher the fitness score, greater are the chances of an individual getting selected for
reproduction.
3. Selection
In this phase, out of all the steps of genetic algorithm, individuals are selected to produce
offspring by arranging them in a pair of two. Three types of selection methods are leveraged in
this process that are listed below.
➢ Rank based selection
➢ Tournament selection
➢ Roulette wheel selection
4. Reproduction
In the reproduction step, the genetic algorithm leverages two variation operators. These are
applied to the parent population. These two operators are:
➢ Crossover
In this process, a crossover point is selected within the genes randomly. This operator then
swaps the genetic information of the two selected parents or say individuals from the current
generation to produce an offspring.
There are various styles for crossover among the parents namely one-point crossover, two-point
crossover, livery crossover, and inheritable algorithms crossover.
The genes of the chosen fittest parents are exchanged until the crossover point is met. When the
process ends, an offspring is produced that includes genes from both the parents.
➢ Mutation
In this process, a random gene is inserted in the offspring in order to maintain the diversity in
the population. There are three types of mutation styles available namely flip bit mutation,
gaussian mutation, and exchange or swap mutation.
This operator helps in resolving the premature convergence issue and enhances diversification
in the population.
Dr. K. Adisesha 2
Genetic algorithm Machine Learning
5. Termination
Now that the offspring is produced, the reproduction face is terminated by applying a stopping
criterion. The algorithm reaches the end of the process after the threshold fitness solution is
reached. Further, it identifies the final yet best solution in the population.
Applications of genetic algorithm in machine learning
Genetic algorithms find use in various real-world applications. In this segment, we have
elaborated on some areas that utilize the genetic algorithms in machine learning.
1. Neural networks
Genetic programming in machine learning finds great applications for neural networks in
machine learning. We use it for genetic optimization in neural networks or use cases like
inheriting qualities of neurons, neural network pipeline optimization, finding the best fit set of
parameters for a given neural network, and others.
2. Data mining and clustering
Data mining and clustering use genetic algorithms to find out the centre point of the clusters
with an optimal error rate given to its great searching capability for an optimal value. It is
renowned as an unsupervised learning process in machine learning, where we categorize the
data based on the characteristics of the data points.
3. Image processing
Image processing tasks, such as image segmentation, are one of the major use cases of genetic
optimization. However, genetic algorithms can also be used in different areas of image analysis
to resolve complex optimization problems.
Dr. K. Adisesha 3
Genetic algorithm Machine Learning
Dr. K. Adisesha 4
Genetic algorithm Machine Learning
A variety of issues can be solved using genetic optimization in the financial market. It helps in
finding an optimal combination of parameters that can affect the trades or market rules. You
can also find out the near-optimal value for the optimal set of parameters.
10. Medical science
Medical signs have an array of use cases for genetic optimization. The areas of predictive
analysis include protein prediction, RNA structure prediction, operon prediction, and others.
Other processes such as protein folding, gene expression profiling analysis, bioinformatics
multiple sequence alignment, or some of the process alignment that uses genetic optimisation.
11. Task scheduling
Genetic machine learning algorithms are used to derive optimal schedules that satisfy certain
constraints related to a problem.
For instance: assume that you have to prepare the schedule for the semester exams for
University. The genetic algorithm will find the best optimal schedule for the university
considering all the constraints like the number of classrooms, the number of students, the total
number of courses and subjects, and others.
12. Economics
Economics is the study of resource utilization in the production, distribution, and complete
consumption of goods and services over a time period. The genetic algorithm creates models of
demand and supply that derive asset pricing, game theory, and others.
13. Robotics
Robotics comprises the construction, design, and working of the autonomous robot. Genetic
algorithms contribute to the robotics field by providing the necessary insight into the decisions
made by the robot. It generates optimal routes for the robot so that it can use the least amount
of resources to get to the desired position.
Advantages of the genetic algorithm
The genetic algorithms put a plethora of advantages on the table. Get acquainted with them in
the next segment.
➢ Genetic algorithms provide solutions or answers that improve over a period.
➢ It does not need any derivative information and has excellent parallel capabilities.
➢ It optimizes several problems, such as continuous functions, discrete functions, and
multi-objective problems.
➢ It comes as the best choice for a wide variety of optimization problems.
➢ It has a large and broad space for solutions search ability.
Dr. K. Adisesha 5