[ENH] Feature Constructor: Evaluate categorical variables to strings#5637
Merged
lanzagar merged 3 commits intoNov 19, 2021
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5637 +/- ##
==========================================
+ Coverage 86.07% 86.11% +0.03%
==========================================
Files 315 315
Lines 66048 66074 +26
==========================================
+ Hits 56854 56901 +47
+ Misses 9194 9173 -21 |
b301dff to
39dad0f
Compare
39dad0f to
839e8bb
Compare
Contributor
Author
|
@lanzagar, I think you'll like this (if it works :). An "Upgrade Expression" button now removes |
janezd
commented
Nov 13, 2021
| return super().data(index, role) | ||
|
|
||
|
|
||
| def freevars(exp, env): |
Contributor
Author
There was a problem hiding this comment.
This function has been moved above the class definition: it is called from migrate_context, which is called from meta class, which is sets up the class. Function below the class definition are not yet defined at that moment.
a1e5733 to
7aa7570
Compare
lanzagar
reviewed
Nov 19, 2021
| if mo.group(3) == ".value": # uses string; remove `.value` | ||
| return "".join(mo.group(1, 2, 4)) | ||
| # Uses ints: get them by indexing | ||
| return "{" + mo.group(1) + \ |
Contributor
There was a problem hiding this comment.
Suggested change
| return "{" + mo.group(1) + \ | |
| return mo.group(1) + "{" + \ |
7aa7570 to
1f399a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #5510. That is, not the original issue but @markotoplak's comment that Feature Constructor should be modified to be more user-friendly.
Description of changes
Values of categorical features are now evaluated to strings, not indices.
Indices were not very useful, also because they referred to indices in a list whose order was not necessarily fixed, therefore this was unstable and dangerous. For this reason -- and because this behaviour wasn't documented anyway (see https://orangedatamining.com/widget-catalog/data/featureconstructor/) -- the only effort towards backward compatibility in this PR is to remove
.valuefrom expressions. Plus, the change is noted in the tooltip and documentation.Includes