-
-
Notifications
You must be signed in to change notification settings - Fork 489
-
Mr Gad,
I have a question about this error:
ValueError: Unable to coerce to Series, length must be 12: given 10000
When running a genetic algorithm with Pygad, and the Churn_Modelling dataset, I get the following error for this line of code:
output = np.sum(solution * function_inputs, axis = 1)
function_inputs = dataset.drop(['Exited'], axis = 1)
desired_output = dataset['Exited']
Help me please? What is the solution to the error?
Thank you for your attention
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments 2 replies
-
I think there is a mismatch between the length of these 2 variables:
solution
function_inputs
As I do not have the code, I may not be able to locate the error accurately. But for now, could you check the length of function_inputs
and solution
and make sure the lengths are equal?
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
It is written as PyGAD not PyGad.
The name is described in the paper about PyGAD: Gad, Ahmed Fawzy. "PyGAD: An Intuitive Genetic Algorithm Python Library." arXiv preprint arXiv:2106.06158 (2021).
Here is the description of the name.
Capture
Note that it is not intentional to give it my last name. The first suggestion I had for the name is PyGA but I already found a library with that name at PyPI. I added the extra character D because it was supporting only decimal genetic algorithm. At that time, I figured out that this is my last name :)
For the pronunciation, check these videos:
Please let me know if I can help in any way.
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Awesome! I hope things are clear in the documentation also.
Beta Was this translation helpful? Give feedback.