Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[ENH] Edit Domain: Merge categorical values #3725
Conversation
ales-erjavec
added some commits
Mar 28, 2019
ales-erjavec
changed the title
[ENH] Edit Domain: Merge categorical features
[ENH] Edit Domain: Merge categorical values
Apr 5, 2019
This comment has been minimized.
This comment has been minimized.
codecov
bot
commented
Apr 5, 2019
•
Codecov Report
@@ Coverage Diff @@
## master #3725 +/- ##
==========================================
+ Coverage 84.53% 84.81% +0.27%
==========================================
Files 373 374 +1
Lines 68471 68749 +278
==========================================
+ Hits 57884 58307 +423
+ Misses 10587 10442 -145 |
ales-erjavec
added some commits
Apr 5, 2019
janezd
reviewed
Apr 10, 2019
|
|
||
| import numpy as np | ||
|
|
||
| import Orange.data | ||
|
|
||
| from Orange.preprocess.transformation import Identity, Lookup | ||
| from Orange.widgets import widget, gui, settings | ||
| from Orange.widgets.data.owconcatenate import unique |
This comment has been minimized.
This comment has been minimized.
janezd
Apr 10, 2019
Contributor
I'd avoid importing functions from widget modules if possible because it messes up dependencies and complicates future refactorings. I think we'd better treat all functions in widget modules as private (even if not named as such), just as we treat widget classes as final.
Do we have a better place for functions like unique?
Perhaps better, isn't unique(s) same as iter(dict.fromkeys(s)) (formally from Python 3.7, de facto already in 3.6). In below code, it's used as list(unique(s)), which is, I suppose, the same as list(dict.fromkeys(s)).
ales-erjavec commentedApr 5, 2019
Issue
Implements gh-3371
Also fixes and assertion error when two values are renamed to the same value.
Description of changes
Implement merging of categorical values.
Merging can be achieved by simply renaming individual values to the same name, or by selecting multiple values and pressing the merge button (shortcut ctrl + =) and entering/selecting a name in an editable combo box.
Includes