Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selections refactor #41

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

aahaselgrove
Copy link
Contributor

Refactored selections.jl to fix some bugs (including issue #40) and improve clarity.

@coveralls
Copy link

coveralls commented Sep 30, 2019

Coverage Status

Coverage decreased (-22.5%) to 77.511% when pulling 340e307 on aahaselgrove:selections_refactor into c7fb224 on wildart:master.

@aahaselgrove
Copy link
Contributor Author

Separated out this change from others so it may be considered independently.

@aahaselgrove
Copy link
Contributor Author

I can see that this change has broken the new selections.jl tests. Could you please explain what uniformranking is meant to do? My understanding of a 'uniform' selection is that each individual has an equal change of being selected. As the sum of probabilities must equal 1, your current implementation and tests don't make sense to me.

@wildart
Copy link
Owner

wildart commented Oct 15, 2019

It isn't just uniform, it is (μ, λ)-uniform ranking which takes μ fittest individuals and selects uniformly from them. λ is a total number of individuals in the population. If you want a uniform selection you need to make that μ = λ.

I test the following:

s = uniformranking(2)
s([1,2,3], 2) == [2,3]

s is the selection function which takes two fittest individuals that are in position 2 & 3 of the first parameters and then selects uniformly from them. I think the better test would be

sort(unique(s([1,2,3], 10))) == [2,3]

It wouldn't rely on RNG settings.

@aahaselgrove
Copy link
Contributor Author

I don't think that removed the dependency on RNG settings, as the selector still chooses randomly. eg. in your example [2, 2] and [3, 3] would be equally valid results.

@wildart wildart force-pushed the master branch 3 times, most recently from f8f9fc4 to cc7ffe2 Compare December 10, 2021 20:29
@wildart wildart force-pushed the master branch 2 times, most recently from 12d8cee to b0f5477 Compare December 20, 2021 02:47
@wildart wildart force-pushed the master branch 2 times, most recently from dd6579c to c81f2c9 Compare December 29, 2021 01:18
@wildart wildart force-pushed the master branch 3 times, most recently from 091f38a to cf3f2fb Compare March 19, 2022 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants