[FIX] MDS: No optimization when subset data#2675
[FIX] MDS: No optimization when subset data#2675lanzagar merged 3 commits intobiolab:masterfrom jerneju:mds-sparse
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2675 +/- ##
=========================================
Coverage ? 75.81%
=========================================
Files ? 338
Lines ? 59497
Branches ? 0
=========================================
Hits ? 45107
Misses ? 14390
Partials ? 0 |
|
Both commits seem OK to me if this is what we want to do with sparse data. @nikicc, @ajdapretnar please confirm. |
|
Add tests for sparse data. |
|
This now works! |
Orange/widgets/unsupervised/owmds.py
Outdated
| def init_attr_values(self): | ||
| domain = self.data and len(self.data) and self.data.domain or None | ||
| if domain is not None and self.data.is_sparse(): | ||
| domain = Domain(attributes=[], class_vars=domain.class_vars) |
There was a problem hiding this comment.
Why only class variables here? What about metas? If this is only here with the purpose of removing sparse features, I would prefer if we use filter_visible method from Orange.data.domain that is used elsewhere (e.g. select rows).
I'm not really a fan of filter_visible, but let's keep the same approach everywhere.
There was a problem hiding this comment.
Perhaps we should support filtering by filter_visible in the model so we got this fixed once and for all?
Orange/widgets/unsupervised/owmds.py
Outdated
|
|
||
| attributes = self.data.domain.attributes + (self.variable_x, self.variable_y) + \ | ||
| primitive_metas | ||
| if self.data.is_sparse(): |
There was a problem hiding this comment.
Why do we need a different logic for sparse here?
|
Also, on hover doesn't show all data for sparse. Is there a special reason for this? |
Not relevant any more, the code in question was moved to #2693
Issue
1. MDS cannot handle sparse data.That will be fixed in #2690 .2. Optimization runs when subset data is sent to the widget. This is not necessary.
3. Plot resets when Show similar pairs slider is moved.
4. Similar pairs are not removed when Show similar pairs slider is set to 0. And they should be removed.
Description of changes
Includes