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

BinaryPSO should return final best position instead of final swarm #293

Merged
merged 1 commit into from
Feb 18, 2019

Conversation

danielcorreia96
Copy link
Contributor

Resolves #292

Description

The binary optimizer returns the entire final swarm instead of the final best position.

I think this happens because in the return stage of the optimize() function, we are copying self.swarm.best_pos which is an array (n_dimensions, particles), instead of the position of the best particle.

The expected behavior is implemented in local_best.py.

Related Issue

#292

Motivation and Context

How Has This Been Tested?

  1. Ran tests locally
  2. Example notebook (feature_selection)
  3. Personal project

Screenshots (if appropriate):

See #292

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@ljvmiranda921 ljvmiranda921 requested review from whzup and ljvmiranda921 and removed request for whzup February 18, 2019 01:44
@ljvmiranda921 ljvmiranda921 merged commit ddf20ce into ljvmiranda921:master Feb 18, 2019
@ljvmiranda921
Copy link
Owner

Merged! Thank you for your contribution, @danielcorreia96 !

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.

BinaryPSO returns swarm positions instead of best particle position
2 participants