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] Test & Learn: do not crash on a data with class only nans #2751

Merged
merged 1 commit into from
Nov 28, 2017
Merged

[FIX] Test & Learn: do not crash on a data with class only nans #2751

merged 1 commit into from
Nov 28, 2017

Conversation

jerneju
Copy link
Contributor

@jerneju jerneju commented Nov 7, 2017

Issue

Widget Test & Learn crashes when receives data with a class which has only nan values. This is because all data is removed and Table suddenly has length 0.

Description of changes

The data is set to None when its length is 0.

Includes
  • Code changes
  • Tests
  • Documentation

@jerneju
Copy link
Contributor Author

jerneju commented Nov 7, 2017

@codecov-io
Copy link

codecov-io commented Nov 10, 2017

Codecov Report

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

@@            Coverage Diff            @@
##           master   #2751      +/-   ##
=========================================
+ Coverage    76.1%   76.1%   +<.01%     
=========================================
  Files         338     338              
  Lines       59760   59770      +10     
=========================================
+ Hits        45479   45488       +9     
- Misses      14281   14282       +1

@jerneju jerneju added this to the 3.8 milestone Nov 10, 2017
@@ -388,6 +388,8 @@ def set_train_data(self, data):
self.Warning.missing_data(self._which_missing_data())
if data:
data = HasClass()(data)
if not len(data):
data = None
Copy link
Member

Choose a reason for hiding this comment

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

Is the warning still OK in this case? I do not know what it is, but we need to show clearly that nothing can get computed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When there is no target variable it shows an error: "Train data input requires a target variable." and now where there is a target variable with only nan values it shows a warning: "Instances with unknown target values were removed from train data.".

What would be the best error / warning message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@markotoplak : Now I fixed it in a different way.

@lanzagar lanzagar merged commit 4130711 into biolab:master Nov 28, 2017
@jerneju jerneju deleted the testlearners-nanclass branch November 28, 2017 11:13
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