GENETIC ALGORITHMS IN MACHINE LEARNING

ISHA GORASHIYA
6 min readApr 12, 2022

--

Introduction:

Charles Darwin, father of Evolution remarked, “It is not the strongest of the species that survives, nor the most intelligent, but the one who is most adaptable to change.” The Genetic Algorithm is a search-based optimization technique based on genetics and natural selection principles. These algorithms are generally used to find optimum solutions to real life complex problems.

There are tons of feasible solutions to a given problem in genetic algorithms. These solutions are then subjected to genetic manipulations, resulting in the birth of new offspring, and the cycle is continued for several generations. The term “optimization” refers to the process of determining input values in order to obtain the “optimal” output values.

Terminologies aligned with Genetic Algorithm:

1. Population: This is a subset of all the possible solutions to the problem at hand.

2. Chromosomes: One of the population’s solutions.

3. Gene: element in chromosome.

4. Allele: the numerical value assigned to a gene on a particular chromosome.

5. Fitness Function: This is a function that improves an output by using a specified input. The solution is provided as the input, and the solution compatibility is the output.

6. Genetic operations: The best people marry in order to have children who are better than their parents. The genetic composition of the following generation is altered using genetic operators.

7. Genotype: In the computation space, the population is known as genotype. The solutions are represented in the computation space in a fashion that can be easily understood and manipulated by a computing system.

8. Phenotype: The population in the actual real-world solution space in which solutions are represented as they are in real-world settings is referred to as phenotype.

9. Decoding and Encoding: Decoding is the transformation of a solution from genotype to phenotype space, whereas encoding is the transformation from phenotype to genotype space.

What are Genetic Algorithms?

Genetic Algorithms are search-based algorithms based on natural selection and genetics principles. These are a subset of Evolutionary Computation, a considerably larger part of computation.

Genetic algorithms are utterly randomised in nature, but they outperform random local search because they also take advantage of previous data.

Characteristics of Evolutionary Algorithms:

Evolutionary algorithms’ primary focus is optimization. Existing algorithms differ from evolutionary algorithms within this, evolutionary algorithms are dynamic. It means that they might vary over time and be effectively employed to represent rapidly altering data.

1. Population-Based: The goal of evolutionary algorithms is to improve a process where the present set of answers is bad or not optimal by generating optimal solutions. The population is a word used to describe a collection of current solutions.

2. Fitness-Oriented: Each unique solution has a fitness value associated with it, which is determined using a fitness function. This fitness value indicates how good the solution is.

3. Variation-Driven: If no satisfactory solution can be found in the existing population based on the fitness function determined for each individual, we must adapt to find new, better alternatives. As a result, individual solutions will go through several iterations in order to develop new ones.

Need of Genetic Algorithms:

Genetic Algorithms have a remarkable ability to produce “good enough” and “quick enough” answers. As a result, genetic algorithms are appealing for use in real-life problems. The reasons are:

1. Solving complex problems:

Consider a circumstance in which a huge number of problems must be resolved. Even the most powerful computing systems require months (if not years) to solve such complex tasks. Genetic algorithms seem to be an excellent tool in this case, providing usable near-optimal solutions in a short period of time.

2. Getting optimal solutions real quick:

Some real-life issues may have multiple answers. In real life, we encounter situations that require simply the most appropriate response. For instance, putting containers of various sizes on a ship port, arranging rooms in a house map so that the end result is the same house area, and placing items in a rack such that there is little space waste can all be considered. Genetic Algorithms can also be used to solve pathfinding difficulties like the Traveling Salesman Problem and VLSI Design.

3. Processing Dynamic Information:

Remember that an Artificial Neural Network requires long-term data, and that data must be able to represent every state that the system attempts to forecast in the future. The network is unable to process unusual data that was not present when the model was created. Genetic Algorithms are able to solve this problem by providing solutions for data that is always changing.

4. Arriving at similar solutions:

Have you ever considered examining and discovering a pattern in previously won lottery numbers in order to win lottery numbers? Genetic algorithms are capable of providing solutions in instances when we need to find some similar matching solutions.

5. Discovery of indirect solutions:

Have you ever considered analysing and identifying patterns in previously won lottery numbers in order to win lottery numbers? In circumstances where we need to find some matching, similar answers, genetic algorithms can help.

6. Random experiments leading to solutions:

We tend to use a random answer as a solution when there are a number of viable answers for a particular problem. However, there is a chance that the random answer isn’t the best solution for the problem. For these kind of random studies, genetic algorithms can be utilised to provide more reliable results.

Basic Structure/ Flow of Genetic Algorithms:

https://www.tutorialspoint.com/genetic_algorithms/images/basic_structure.jpg

1. Initialization of population:

There are primarily two ways of initializing population in Genetic Algorithm. They are:

a. Random Initialization: Completely random solutions should be used to populate the initial population.

b. Heuristic Initialization: Use a recognised heuristic for the problem to populate the initial population.

Using a heuristic to initialise the entire population can result in the population have same solutions and minimal variability. It has also been discovered that, in some instances, heuristic initialization merely affects the population’s initial fitness, and that ultimately it is the variety of the solutions that leads to optimality.

2. Fitness Function:

The fitness function is a function that takes a candidate solution to a problem as input and outputs how “fit” or “excellent” the answer is with respect to the problem at hand.

Characteristics required for fitness function:

a. The fitness function should be computed quickly enough.

b. It must quantify the fit of a particular solution or the fit of persons that can be produced from that solution.

Maintaining a high level of demographic variety is critical to a Genetic Algorithm’s success. Caution should be exercised to avoid a single exceptionally fit solution sweeping the entire population. This would result in solutions being too close to one another in the solution space, reducing diversity.

3. Crossover:

Crossovers are a process in which more than one parent is chosen, and their descendants are generated using the combined genetic information of both parents.

4. Mutation:

It’s a genetic change that allows scientists to keep and add variation to a genetic population. A mutation is a minor random change in the chromosomes that results in a new solution for a problem, usually with a very low chance of success.

5. Survivor Selection:

The Survivor Selection Policy selects who is to be kicked out of the next generation and who is to be kept. It is critical because it must ensure that the fittest individuals are not pushed out of the population while also maintaining population variety.

6. Termination:

When an algorithm has reached a threshold fitness solution, it will stop trying to find an answer that is the best in the population. To offer a reason for termination, a stopping criterion is used.

Applications of GA in ML:

1. Transport:

2. DNA Analysis

3. Multimodal optimization

4. Aircraft design

5. Economics

6. Neural networks

7. Image processing

8. Vehicle routing problems

Limitations:

1. Due to its ability to work with majorly high complexity, it doesn’t support easy tasks that well.

2. There are chances of convergence of solutions.

3. Quality is compromised because sometimes the predicted doesn’t occur.

4. At times the computational costs increase while sorting with real life scenario.

Conclusion:

The above written blog talks about the genetic problems/algorithms that we have discovered to put an end. These algorithms are based on heuristic search-based approach. The treatments and the research behind this topic are intensive and real. These algorithms have real sense when it comes to finding possibilities. Thus, these are effective and valuable algorithms in the field of machine learning.

Reference:

--

--