First I have converted the labels into categorical labels.
Secondly, I got the line new_individual = random.choice([parentA, parentB]) one indent backward to prevent the program from calculating that for the number of layers. Eventually, it will need that at the end.
Finally, thanks to the PyCharm, I have fixed all the typing issues and I used yapf tool to write all the codes in order to PEP 8.
There were 2 issues with the code.
First I have converted the labels into categorical labels. Secondly, I got the line
new_individual = random.choice([parentA, parentB])
one indent backward to prevent the program from calculating that for the number of layers. Eventually, it will need that at the end.Finally, thanks to the PyCharm, I have fixed all the typing issues and I used yapf tool to write all the codes in order to PEP 8.