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

[FIX] OWBoxPlot: Faster selection #2595

Merged
merged 1 commit into from
Sep 21, 2017
Merged

[FIX] OWBoxPlot: Faster selection #2595

merged 1 commit into from
Sep 21, 2017

Conversation

lanzagar
Copy link
Contributor

@lanzagar lanzagar commented Sep 18, 2017

Issue

Selection of instances in Box Plot had complexity O(n_all * n_selected), making it too slow / freeze for data with a couple thousand instances.

Description of changes

Use faster membership testing.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov-io
Copy link

codecov-io commented Sep 18, 2017

Codecov Report

Merging #2595 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2595      +/-   ##
==========================================
+ Coverage   75.07%   75.07%   +<.01%     
==========================================
  Files         327      327              
  Lines       57723    57723              
==========================================
+ Hits        43336    43338       +2     
+ Misses      14387    14385       -2

if inst in selected]
selected_ids = set(selected.ids)
selection = [i for i, id in enumerate(self.dataset.ids)
if id in selected_ids]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

selection = np.in1d(self.dataset.ids, selected.ids).nonzero()[0]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better 👍

@astaric astaric merged commit 4ebe394 into biolab:master Sep 21, 2017
@lanzagar lanzagar deleted the fastsel branch March 14, 2022 14:41
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.

4 participants