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] OWLearnerWidget: Don't crash when no features #1389

Merged
merged 1 commit into from
Jun 30, 2016

Conversation

nikicc
Copy link
Contributor

@nikicc nikicc commented Jun 30, 2016

If we provide a data set without any features (as unpreprocessed Corspus) learners crashed with a red screen. This PR adds a check for this and shows an error message instead.

@codecov-io
Copy link

codecov-io commented Jun 30, 2016

Current coverage is 87.61%

Merging #1389 into master will not change coverage

@@             master      #1389   diff @@
==========================================
  Files            75         75          
  Lines          7460       7460          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           6536       6536          
  Misses          924        924          
  Partials          0          0          

Sunburst

Powered by Codecov. Last updated by ee5b063...9af9a51

@@ -186,6 +186,9 @@ def check_data(self):
self.error(self.DATA_ERROR_ID,
"Data contains a single target value. "
"There is nothing to learn.")
elif self.data.X.size == 0:
self.error(self.DATA_ERROR_ID,
"Found array with 0 feature(s) while a minimum of 1 is required.")
Copy link
Contributor

Choose a reason for hiding this comment

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

"Data has no features to learn from."? Zero features are plural. 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was being sloppy and just copied the error from scikit 🙈 Corrected.

If we provide a data set without any features (as unpreprocessed Corspus) learners crashed with a red screen. This PR adds a check for this and shows an error message instead.
@nikicc nikicc force-pushed the empty-data-error branch from 385c44b to 9af9a51 Compare June 30, 2016 16:44
@kernc kernc merged commit 7639987 into biolab:master Jun 30, 2016
@nikicc nikicc deleted the empty-data-error branch June 30, 2016 19:37
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.

3 participants