done as a project in Machine Data and Learning course, MDL | Spring 2021
Genetic algorithm is often used in parameter selection and obtaining optimal solutions. We have been given coefficients of features(a vector of size 11) corresponding to an overfit model and our task is to apply genetic algorithm in order to reduce the overfitting i.e. generalize the model so that the model performs better on unseen data.
- python3 json_dump.py
- python3 main.py
Each run you get only one generation, no.of times you run is no.of generations you run.Make generations==0 in line 138 from second run.
The genetic algorithm is a search heuristic that is inspired by Charles Darwin’s theory of natural evolution. This algorithm reflects the process of natural selection where the fittest individuals are selected for reproduction in order to produce offspring of the next generation.
Five phases are considered in a genetic algorithm.
- Initial population
- Fitness function
- Selection
- Crossover
- Mutation
see report for more details.