# What is meant by gene, chromosome, population in genetic algorithm in terms of feature selection?

I am trying to understand the genetic algorithm in terms of feature selection and these features are extracted using a machine learning algorithm.

Let's suppose I have data of heart rate for 3 minutes collected from $$50$$ subjects. From these 3-minute heart rate, I extracted $$5$$ features, like the mean, standard deviation, variance, skewness and kurtosis. Now the shape of my feature set is (50, 5).

I want to know what are gene, chromosome and population in genetic algorithm related to the above scenario.

What I understand is each feature is a gene, and a set of all features for one subject (1, 5) is the chromosome, and the whole feature set (50, 5) is a population. But I think this concept is not correct. Because in the genetic algorithm, we take a random population, but according to my concept complete data is population, so how random data is selected.

Can anyone help me to understand it?

• What is a goal of the model? Regression, classification or something else? I think your 50 subjects are nor individuals of a population, but a part of a way to define a fitness function. Individuals of a population will be binary 5-element vectors, that represent if features are important or not. – oleg.mosalov Jun 23 '20 at 13:43
• its classification, the fitness function gives accuracy – Talha Anwar Jun 24 '20 at 0:04

A chromosome in this case could be a set of filters, each extracting a different feature (analogous to Convolutional Neural Network). Your question doesn't say what you want to do with these features, so this solution is made under the assumption that there is a fitness function which would take these features as an input and output a score. Then, each gene is a parameter for a filter, each chromosome defines a set of such filters, which makes up an individual. A population is a set of such individuals.

Genetic algorithms, also known as evolutionary search, provide a general technique to optimize an objective function. We also say that we are trying to maximize fitness. This means that we are trying to find an individual with the highest possible fitness. We start with a population, say 100 individuals, and using mutation and crossover we generate offspring among whom we hope to find fitter individuals and as the generations progress, we get better and better.

One way to start this all is to think about the "fitness" or objective function. What is it that we want in the best individuals? Can we model that? How do we model that?

In your case, does a specific measurement (those 5 numbers you mention) say how fit an individual is? And that fitness can be one number, say from 1 to 100, or it could be unbounded (as in real life where things get better and better with temporary regressions).

So the challenge is how to map the features to a number. That's a math function to design.

Genes are what change from individual to individual and they mutate from parent to offspring and they are shared in crossover. Given a set of genes, what is the fitness? If you can answer that question (meaning a mathematical function to map the genes of each individual to a number), then you have a genetic algorithm to run and it will find the fittest individuals according to your (math) function.