Creating Genetic Algorithms With Python:

Victor Sim
Analytics Vidhya
Published in
6 min readAug 17, 2020

--

Creating Genetic Algorithms With Python:

Introduction:

Everyone knows about neural networks and Gradient Descent, but much less are familiar with unsupervised machine learning algorithms. Today I am here to introduce Genetic Algorithms and their implementation in Python, and hopefully, get you to understand more about genetic algorithms as well.

Genetic Algorithms:

Genetic Algorithms, like other machine learning algorithms, are trying to optimize a set of hyper-parameters to make predictions of a neural network as accurate as possible.

Gradient Descent and other optimization algorithms usually use partial derivatives to find the general direction to minimize the loss function and thus improve the accuracy of the neural network.

Genetic Algorithms, on the other hand, mimic evolution to optimize the network. Here how it works:

  1. An agent is generated. It contains a set of weights that are compatible with the neural network.
  2. The agent’s fitness value is calculated by comparing predictions made with the set of weights and the true y-values.
  3. Repeat this many times until you have a “population” of agents

--

--

Victor Sim
Analytics Vidhya

Interested in Machine Learning. Open to internships and opportunities. Connect at https://linktr.ee/victorsi.