Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IndexError in the best_solution function in line 3124 #93

Closed Answered by augustodamasceno
augustodamasceno asked this question in Q&A
Discussion options

After some time running the GA function ga_instance.run(), a IndexError occur in the following line:

best_match_idx = numpy.where(pop_fitness == numpy.max(pop_fitness))[0][0]

Has anyone come across this index error before? How did you resolve it?

After I modified the fitness parameters to a more appropriate setting I was able to get GA to run for longer, however the Index error still persists.

Thanks for anyone's help.

You must be logged in to vote

Problem fixed changing keep_parents from 1 to -1.

I think the problem was the population size decreasing to 0.

Replies: 2 comments 1 reply

Comment options

Hi @augustodamasceno,

It it possible to share the code?

You must be logged in to vote
1 reply
Comment options

Thanks. Problem fixed change keep_parents from 1 to -1.

Comment options

Problem fixed changing keep_parents from 1 to -1.

I think the problem was the population size decreasing to 0.

You must be logged in to vote
0 replies
Answer selected by augustodamasceno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working

AltStyle によって変換されたページ (->オリジナル) /