This document provides instructions for an assignment to use genetic algorithms to fit a polynomial equation to a dataset. Students are asked to find the best parameter values for a polynomial with terms up to the fifth power using a genetic algorithm approach. The algorithm should generate an initial random population of 100 individuals, apply mutation 100 times, and print the best fitted parameter values a, b, c, d, e, and f.
This document provides instructions for an assignment to use genetic algorithms to fit a polynomial equation to a dataset. Students are asked to find the best parameter values for a polynomial with terms up to the fifth power using a genetic algorithm approach. The algorithm should generate an initial random population of 100 individuals, apply mutation 100 times, and print the best fitted parameter values a, b, c, d, e, and f.
This document provides instructions for an assignment to use genetic algorithms to fit a polynomial equation to a dataset. Students are asked to find the best parameter values for a polynomial with terms up to the fifth power using a genetic algorithm approach. The algorithm should generate an initial random population of 100 individuals, apply mutation 100 times, and print the best fitted parameter values a, b, c, d, e, and f.
We covered in class on how to find the best parameters for the line fitting example. In this assignment you have to use the same ideas to find the parameters of the following equation: 𝑦 = 𝑎𝑥 5 + 𝑏𝑥 4 + 𝑐𝑥 3 + 𝑑𝑥 2 + 𝑒𝑥 + 𝑓 Please note that your genes in this case are: a, b, c, d, e, f Use the following dataset: (x, y) : {(1,1.5), (0.5, 1), (2, 1.5), (2.5, 2.5), (3, 3.5), (4, 5), (5, 5.5), (6, 5.6), (6.5, 5.8), (6.7, 5.9)} You have to create a Python notebook, generate a initial random population of 100 individuals. (For this you can generate random numbers between 0 and 10 using the randint function from the random package). Then, you have to apply mutation 100 times to find the best parameter values. Then, print the best gene values. Note: 1. When you have to create a new individual, use the deepcopy function from the copy package in Python. 2. To apply mutation i.e. to toggle k bit of a number n, you can define the following function in your notebook: