-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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] Scatter Plot: VizRank disabled when no class vars #2757
[FIX] Scatter Plot: VizRank disabled when no class vars #2757
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2757 +/- ##
==========================================
+ Coverage 76.05% 76.06% +<.01%
==========================================
Files 338 338
Lines 59670 59683 +13
==========================================
+ Hits 45380 45395 +15
+ Misses 14290 14288 -2 |
domain = Domain( | ||
attributes=data2.domain.attributes[:4], class_vars=DiscreteVariable("iris", values=[])) | ||
data2 = Table(domain, data2.X, Y=data2.Y) | ||
data3 = Table("iris")[::30] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between data1 and data3? (i.e. why this line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now there is the difference.
@@ -252,6 +252,8 @@ def set_data(self, data): | |||
self.vizrank_button.setEnabled( | |||
self.data is not None and not self.data.is_sparse() and | |||
self.data.domain.class_var is not None and | |||
(len(self.data.domain.class_var.values) | |||
if self.data.domain.class_var.is_discrete else True) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the case when the class has no values. How about when the class has e.g. 3 values, but all instances have unknown classes (e.g. a test set with the same variable as the training set, but class unknown)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Updated.
Issue
Scatter Plot VizRank crashes when class column has only
nan
values.Description of changes
VizRank is disabled as it is when there is no
class_var
.Includes