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

k-means speciation is not handling empty clusters/species. #52

Open
colgreen opened this issue Dec 29, 2020 · 0 comments
Open

k-means speciation is not handling empty clusters/species. #52

colgreen opened this issue Dec 29, 2020 · 0 comments

Comments

@colgreen
Copy link
Owner

colgreen commented Dec 29, 2020

The standard k-means algorithm may result in empty species, e.g. consider this example in 1D space:

Initial clusters

      {2, 3, 3, 3}
      {3, 7, 7, 7}
      {7, 8, 8, 8}.

For k=3, the first update will empty the middle cluster.

Once the cluster is empty it has no centroid, and therefore will not gain any genomes in later iterations, i.e. it will remain empty at completion of the k-means iterations.

This is currently somewhat/partly handled by NeatEvolutionAlgorithm.IntegrateOffspringIntoSpecies(), which 're-speciates' the full population if one or more species are empty, but that re-speciation uses k-means clustering, so it can still produce empty species.

Other code may then assume that all species obtain at least one genome, and thus other problems may result from this.

Also see https://stackoverflow.com/questions/11075272/k-means-empty-cluster

@colgreen colgreen transferred this issue from another repository Jan 1, 2023
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

No branches or pull requests

1 participant